What is instance variable in Java?

 
 

Share on Google+Share on Google+

Java Coder
What is instance variable in Java?
1 Answer(s)      8 months ago
Posted in : Java Beginners
Ads

Hi,

What is instance variable in Java?

What is the use of instance variable?

Thanks

Ads
View Answers

April 16, 2017 at 10:48 PM


Hi,

In Java programming classes are used as base of Object oriented programming. Any variable which is defined in a class is know as instance variable. This is also know as a member variable.

If you create 10 instance of the class then each instance will have their own separate copy of data.

Check example at Example of a instance variable.

Thanks


Ads









Ads

 
Advertisement null

Ads