Base of difference | Class Variables | Instance Variables |
Keyword | Class variables are mainly declared with keyword static. | Instance variables are mainly declared without static keyword. |
Accessed by | Class variables can be accessed by using either class name or by object reference. | On the other hand Instance variables can be accessed by only through object reference. |
Shared | Class variables are common to all instance of class and these variables are shared between the objects of a class. | On the other hand Instance variables are not shared between the objects of a class and each instance have their own copy of instance variables. |
Reflect | As class variables are common to all objects of a class, changes made to these variables through one object will reflect in another. | As each object will have its own copy of instance variables, changes made to these variables through one object will not reflect in another object. |