Multiple choice java

Which is true about a method-local inner class?

  1. It must be marked final

  2. It can be marked abstract

  3. It can be marked public

  4. It can be marked static

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Method-local inner classes are defined within a method body. They can be marked as abstract or final. However, they cannot have access modifiers like public, private, or protected because their scope is strictly limited to the method, nor can they be static as they are tied to an instance.