Static data members
|
Non Static data members
|
- static
data members are declared with static modifier.
|
- Non
static data members are declared without
static modifier
|
- Static
data members are created in class memory
|
- Non
Static data members are created in object memory
|
- We
can access static data members by using class name or by using reference
pointing object or pointing to null.
|
- We
can access non static members only using object or object pointing to
reference.
|
- Static
data is common for all objects
|
- Non
static data is specific for each and every object
|
- Static
variables are called class variables.
|
- Non
static variables are called as instance variables or object variables.
|
- Static
data can be access in both static and non static methods.
|
- Non
static data can be access only in non static methods.
|