What are static methods?

Methods declared with the keyword static as modifier are called static methods or class methods. They are so called because they affect a class as a whole, not a particular instance of the class. Static methods are always invoked without reference to a particular instance of a class.

Note:The use of a static method suffers from the following restrictions:

• A static method can only call other static methods.

• A static method must only access static data.

• A static method cannot reference to the current object using keywords super or this.