Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners What is a local, member and a class variable?

Have Programming Question? Ask it here!
 
 
 


Java Coder
What is a local, member and a class variable?
1 Answer(s)      a year and 4 months ago
Posted in : Java Beginners


Hi,

What is a local, member and a class variable?

thanks,


Advertisement
View Answers

April 16, 2013 at 1:27 PM


Hi friend,

Variables are used to store some values which may be changed. In Java we can declare the variables in different ways and these variables have the limited visibility scope, such as if a variable is declared within a method, constructor, and a block then it is called local variables, variables declared with static keyword inside a class but outside the method then it is called class variable. Here you have asked about member variables so, let you know that the instance variables and class variables are called member variables. A member variables belongs to a particular instance of class i.e. object. These variables are initialized just before the constructor is called.

For more detail please go through the following link

http://www.roseindia.net/java/java-tips/data/variables/45local-inst-class.shtml



Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com