This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Instance/Class Variables/Methods" Watch "Instance/Class Variables/Methods" New topic
Author

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
Greenhorn

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instance/Class Variables/Methods
 
Similar Threads
Sttatic vs non static methods
java (beginner)
Static and Instance fields
Cannot resolve Varibles
In an innerclass, how to access the final variable of the enclosing method