hi friends
Earlier, i wrote how main method is executed by JVM. Here i have posted, why main() is public static.
Correct meaning of public static void main()
public : it is visible to all. (so that main is accessible by JVM & other classes)
static : without creating instance / object of class, JVM invoke main() with help of class in which main is declared.
void : it is return type of main(), which return nothing.
main() : main is name of method designed by compiler designer.
main is static , because it is entry point of java application. so JVM search the class in which main method in declared & invoke it by class name.
0 Comment(s)