What is instance variable in Java?

Hi,

What is instance variable in Java?

What is the use of instance variable?

Thanks

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









Related Tutorials/Questions & Answers:
Advertisements