The class variable is a static variable and it does not belong to any instance of class but shared across all the instances.
The member variable belongs to a particular instance of class and can be called from any method of the class.
The automatic or local variable is created on a method entry and valid within method scope and they have to be initialized explicitly.


3 comments:
A member variable cannot be called from a static method.
If a member var is static then it should be..
If a variable is static in the class, it isn't named as 'member' variable, it is a 'class' variable.
Therefore member variables cannot be static. They are members of an instance.
Post a Comment