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.

Advertisements

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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: