What is the difference between an instance variable and a static variable?
Answer:
-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.
Share To Friends Via:
More Questions For Programming in Java:
What is Java? (Answered) What is Java? . Posted On:Sat 20, March 2021 20:03:42 pm