What is the scope of a local variable in Java?
Advertisements
Question
What is the scope of a local variable in Java?
Short Answer
Advertisements
Solution
The scope of a local variable in Java is limited to the method, constructor, or block in which it is declared. It can be accessed and used only within that particular region of the program and cannot be accessed outside its scope.
shaalaa.com
Is there an error in this question or solution?
