QUESTION IMAGE
Question
what type of variable is declared inside a method and is not accessible to statements outside the method?
o default
o local
o field
o class
A local variable is declared inside a method and has scope only within that method. It is not accessible to statements outside the method. Class - level variables (fields) are accessible from multiple methods within the class and can sometimes be accessed from outside the class depending on their access - modifiers. Default is an access - modifier for class - level elements in Java (package - private).
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
C. local