aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What's the difference between instance variable and class variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What Watch "What New topic
Author

What's the difference between instance variable and class variable?

theMatrix
Greenhorn

Joined: Jun 15, 2001
Posts: 4
What's the difference between instance variable and class variable?
datakix
Greenhorn

Joined: Jun 19, 2001
Posts: 2
The difference between an instance variable and a class variable is that an instance variable does not belong to the class, it belongs to an object (an INSTANCE of a class); whereas the class variable belongs to the class and not to any INSTANCE of the class.
- datakix
william shen
Ranch Hand

Joined: Jun 07, 2001
Posts: 60
generally,we can say variables with the static modifier are class variables and the rest are instance variables.
Originally posted by theMatrix:
What's the difference between instance variable and class variable?

Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
datakix
Please read the JavaRanch Name Policy and re-register using a name that complies with the rules.
Thanks for your cooperation.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's the difference between instance variable and class variable?