Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
what is use of static variable in java
Posted

static variable

1.It is a variable which belongs to the class and not to object(instance)
2.Static variables are initialized only once , at the start of the execution . These variables will be initialized first, before the initialization of any instance variables
3.A single copy to be shared by all instances of the class
4.A static variable can be accessed directly by the class name and doesn’t need any object
5.Syntax : <class-name>.<variable-name>


http://www.roseindia.net/java/beginners/staticvariable.shtml[^]

http://blog.sanaulla.info/2008/06/24/static-members-static-methods-and-static-variables/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900