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 
 1 Answer(s)
  1137  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

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