Static Class MethodIf a variable X of a class C is flagged as static, there will be only one copy of X no matter how many instances of C are created. Like a global variable.
Static variable exists from the start of the execution of the program, before any instances of any classes have been constructed.
Static class methods – may be contrasted with other methods of the class which are called member methods
Member vs. Class
- Member methods can only be invoked on instances of the class; static methods may be invoked on instances or may be called even if we don’t have an instance of the class at hand.
-
Static methods only refer to static variables of the class, not ordinary (member) variables; member methods of the class may refer to both the static variables as well as the member variables of the class



