Can static methods be called on instances of the class?

  • Yes
  • No
  • It depends on how the static method is defined
  • Only if the class is instantiated with the new keyword
Yes, static methods can be called on instances of the class. However, it is more common and recommended to call static methods on the class itself, as they are associated with the class, not with a specific instance.
Add your answer
Loading...

Leave a comment

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