Java OCA OCP Practice Question 1510

Question

A local inner class can access which type of local variables?

  • I. final
  • II. private
  • III. effectively final
  • A. I only
  • B. I and II
  • C. III only
  • D. I and III


D.

Note

A local inner class can access final or effectively final local variables.

Option D is the correct answer.

The second statement is invalid because access modifiers like private cannot be applied to local variables.




PreviousNext

Related