This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Adjectives for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Adjectives for "variable" - automatic/local/member/method/method level/instance/class" Watch "Adjectives for "variable" - automatic/local/member/method/method level/instance/class" New topic
Author

Adjectives for "variable" - automatic/local/member/method/method level/instance/class

Meena
Greenhorn

Joined: Sep 29, 1999
Posts: 12
I have a variety of different Java materials and books in which variables are described with completely different adjectives. I just wish there was a concensus.
Which of these words mean the same exact thing, and what specifically do they mean?
"automatic" variable
"local" variable
"member" variable
"method" variable
"method level" variable
"instance" variable
"class" variable
Question 1: If I wanted words to describe variables that are in a class body but outside of methods or constructors, wich of the above adjectives would I use?
Question 2: If I wanted words to describe variables that are in a method body within a class, which of the above adjectives would I use?
Question 3: If I wanted words to describe variables that are in a class within another class, which of the above adjectives would I use?
Question 4: Is there another category that I didn't mention in Question 1 - Question 3 above?

Thanks!
Thandapani Saravanan
Ranch Hand

Joined: Oct 17, 1999
Posts: 117
Hi,
Ans(1) :
Variables that are declared inside the class are called member variables. A member variable could either be class variable (if it is declared as static) or an instance variable (if it is not declared as static).
Ans(2):
Variables that are declared inside a block or for loop are called local variables. (in c, we used to call this automatic variable)
I don't know which book you are referring to when you say method level variable. As for as words are concerned the authenticated book, i belive is
The Java Language Specification
by
James Gosling
Bill Joy
Guy Steele.
Good luck,
Saravanan
------------------


Saravanan
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20495
    ∞

Q1: class attribute
Q2: local variable
Q3: class attribute
Q4: Parameters.


permaculture Wood Burning Stoves 2.0 - 4-DVD set
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adjectives for "variable" - automatic/local/member/method/method level/instance/class
 
Similar Threads
Sun Cirtification
Autoboxing and initialization of non-instance variables (Need cameron's permission)
what is a member variable
Isn't this contradictory ?
types of variables