Home > DeveloperSection > Interviews > What is the difference between an instance variable and a static variable in java?

Posted on    March-26-2014 1:54 AM

 Java Java 
Ratings:
 1 Answer(s)
  987  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Points:3910
Posted on    March-26-2014 12:00 AM

Class variables are called static variables. There is only one occurrence of a class variable per JVM per class loader.When a class is loaded the class variables are initialized.

Instance variables are non-static and there is one occurrence of an instance variable in each class instance.Also known as a member variable or a field.


Don't want to miss updates? Please click the below button!

Follow MindStick