The static keyword is a Java modifier which associates a class member or method with a class rather than an instance of a class.
For instance, the main method of a class is always static as there must be exactly one instance of the class containing main in order for the compiler to find it.
A class containing static members or methods does not require instantiation in order to use the static methods of the class.
No comments:
Post a Comment