Instance Variables or ,Non Static Variable In Java

Instance Variables or ,Non Static Variable In Java

1-If the value of a variable is varied from object to object such type of variable are called instance or , non static variable .

2-For every object a separate copy of instance variable will be created .

3-instance or , non static variable should be declared within the class directly but outside of any block,method or constructor

4-instance variable will be created at the time of object creation and destroy at the time of object destruction hence the scope of instance variable is exactly same as the scope of object .

5-instance variable will be stored in the heap memory at the part of object .

6-we cant access instance variable directly from static area but we can access by using object reference 


7-but we can access instance variable directly from instance area .

8-for instance variable jvm always provide default values and we are not require to perform initialization explicitly .

9-instance variable also known as object level variable . .

Share this

Related Posts

Previous
Next Post »

Recent