Static metjods and variable belong to the class, and as such they can be called with out creating an instance (object) of the class.
As no object of the class exists a static method can not call any non static methods becuase it dosnt have access too them (there is no
this available to a static method).
The classic example of static variables is for counting the instances of a given class. For example you might wish to know how many users are logged into the system, or how many requests are currently in a ssystem.
Another use of static variables is as constants (public final static) for a given class/object or API, although enum is perhaps better.
One use of static methods (along with static variables) is in creating
Singletons.
non static methods,
can call static methods.
How this helps
G
[ August 06, 2007: Message edited by: Gavin Tranter ]