|
: 22 : 22 : 0 |
In other OO programming languages, there are class methods and attributes. These members are shared by all objects of the class.
In Java, these members are flagged by the "static" modifier before the identifier.
Class methods can be called on the class itself without the need for an object.
They are essential for some class "self-management" capabilities, like counting the instances of a class or having a list of all created objects.
Class members are necessary for the common Singleton design pattern and useful for object pools (like database connections).
|