Home           J2EE Concepts           JMS           Java Language           Contact           Back           Next           Bookmark this Page          










Some useful tips related to:
 - health & fitness
 - vehicle care
 - cooking
 - misc household tasks

The static keyword


When you precede declaration of a data member/method by static keyword; the member becomes accessible through all objects of that class. In fact, you can even access that member by its class name. This also means that static variables are global variables (& this is the reason why main method of any class is declared static).

Methods declared as static have following limitations:
- They can only access static data members.
- They can only invoke other static methods; they can not invoke non-static methods.
- Static methods can not use this or super keyword.
- If no access level is defined, then Java applies default access control.