Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what type of variable is declared inside a method and is not accessible…

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

Explanation:

Brief Explanations

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).

Answer:

C. local