What are static methods

What are static methods

Answer: Methods declared static has below restriction:

  • They can only call other static methods.
  • They must only access static data.
  • They cannot refer to this or super in any way.
  • They can be accessed directly using class and don’t instance of class to access it

Leave a Reply

Your email address will not be published. Required fields are marked *

I am not Robot *