+ 1
What is static method? Why need to define as static?
2 ответов
+ 2
Static Method is a class method. It can be accessed by class name not by object. It gets initialized on loading itself. It allocates common memory for all.
+ 1
we have to define a method as static because it can access only static variables .