jump to navigation

What does it mean that a method or field is “static”? November 28, 2006

Posted by Allu in JAVA.
trackback

Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class.
 Static methods can be referenced with the name of the class rather than the name of a particular object of the class.

Comments»

1. Vijay - November 30, 2006

why do one need static methods ? can you give me some real time situations with the need for static methods and fields with brief examples.

2. Nanda Kumar - March 21, 2007

Straight forward answer . good answer. And it is good answer by alla.

Thankx

3. vinoth - September 26, 2007

pl explain me with example


Leave a comment