Which variables have a scope limited to a method?



Which variables have a scope limited to a method?

A. Interface variables

B. Class variables

C. Instance variables

D. Local variables

Answer:

D. Local variables

Explanation:

In Java, only local variables have such a small scope, making Option D the correct answer.

Free Spring Boot Tutorial - 5 Hours Full Course


Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course

Comments