Tutorials for Java ,Core java ,Advance java ,oracle ,HTML, CSS, JavaScript, Java and other programming language tutorial Learn Java tutorial for beginners with examples in eclipse online. Java tutorial point for core java, servlet, jsp, struts, spring, for learning web technologies online. Content includes tutorials and references relating to HTML, CSS, JavaScript, PHP, AngularJS, SQL, Bootstrap, Node.js, and jQuery this is a website like w3school tutorialspoint etc

Search This Blog


Header Ads

Saturday, 3 March 2018

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 . .

No comments:

Post a Comment