Cited from the Book Java How to Program
A key part of enabling the JVM to locate and call method main to begin the application’s execution is the static keyword (line 7), which indicates that main is a static method. A static method is special, because you can call it without first creating an object of the class in which the method is declared.
Typically, you cannot call a method that belongs to another class until you create an object of that class.
No comments:
Post a Comment