Based on the position of declaration & behavior all variables are divided into three parts.
1.instance variable
2.static variable
3.local variable
1.instance variable:-
- If the value of a variable varied from object to object is called Instance variable.
- For every object, a separate copy of instance variable will be created.
- Instance variable should be declared within the class directly, but outside of any method/block/constructor.