+ 11
Qus:-What is meant by Local variable and Instance variable?
2 ответов
+ 5
Instance variables and class variables are declared inside the class.
Local variables are declared inside the method.
+ 4
The variable defined inside method, constructer or block is called local variable.
The variable declared and initialized within the method and it will be destroyed when method has completed.
And the instence variable are declared inside a class but outside any method .
These variable are instantiated when the class is loaded..