Computer Applications

Differentiate between instance variable and class variable.

Java Classes

ICSE 2011

56 Likes

Answer

Instance VariableClass Variable
They are declared without using keyword 'static'.They are declared using keyword 'static'.
Each object of the class gets its own copy of instance variables.All objects of a class share the same copy of class variables.
They can be accessed only through an object of the class.They can be accessed using the class name or object.

Answered By

29 Likes


Related Questions