main method in java is static
This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked via the class.
Why is the java main method static?
This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked via the class.