aspose file tools
The moose likes Beginning Java and the fly likes Instance/Class Variables/Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Instance/Class Variables/Methods" Watch "Instance/Class Variables/Methods" New topic

Instance/Class Variables/Methods

Steven Alvarez
Ranch Hand

Joined: Nov 01, 2006
Posts: 66
Can someone please give a CLEAR explanation on what is a Instance Variable, Instance Method, Class Variable, and Class Method? Thanks a lot!
Maddukuri Sudheer

Joined: Jan 09, 2007
Posts: 4
The Java programming language uses both "fields" and "variables" as part of its terminology. Instance variables (non-static fields) are unique to each instance of a class. Class variables (static fields) are fields declared with the static modifier; there is exactly one copy of a class variable, regardless of how many times the class has been instantiated. Local variables store temporary state inside a method. Parameters are variables that provide extra information to a method; both local variables and parameters are always classified as "variables" (not "fields").

Sudheer M
It is sorta covered in the JavaRanch Style Guide.
subject: Instance/Class Variables/Methods