What is a static method? how they are accessed?
Static method are attached to aclass but dont need that class should be instantiated to exrcute that method they usually used to instantiate the class
Static method can be accessed by doubled colon(::)
Pubilc static mystaticmethod()
{
}
then this method can be accessed by
myclass::mystatic method();
Static method are attached to aclass but dont need that class should be instantiated to exrcute that method they usually used to instantiate the class
Static method can be accessed by doubled colon(::)
Pubilc static mystaticmethod()
{
}
then this method can be accessed by
myclass::mystatic method();
No comments:
Post a Comment