Why is a static method considered a method?

This quote from 8.4.3.2 may help:

A method that is declared static is called a class method.

A method that is not declared static is called an instance method […].

  • Class methods: associated with a class.
  • Instance methods: associated with an instance.

Java just wants you to “think object-oriented”. Also, static methods have access to a surrounding scope which may include state. In a way, the class is like an object itself.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)