95: Static Variables and Methods (Java)
January 19, 2017
Posted by on
In the Java programming language, both variables and methods within a class can be static or non-static. For a variable or method to be static means that it can be accessed without referencing an instance of the containing class.
If something is non-static, for example a method belonging to a class , one must use an instance of to call :
whereas if was static, it could simply be called with reference to the class itself:
Static methods can be called with reference to class instances, but this is generally considered poor form.