What are static methods?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What are static methods?
Rating:
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.
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.
Rating:
Was this information helpful?
Other articles
- What is an ExceptionInInitializerError?
- What is the default value of the elements of an array?
- What is an enumeration?
- What is the toHexString() method of the Double class?
- What is a local class?
