Multiple choice

Which modifiers may be used with an inner class (non-local), which is a member of an outer class?

Classes use some access specifiers for their accessibilty in other classes or packages.

  1. Public, protected

  2. Only public

  3. Public, protected, private, static, final, or abstract

  4. Only static

  5. Public, private, protected, static but not final

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

All the accessibilties can be given to non-local inner class, which is a member of the outer class. It only gives weaker accessiblilty to non-local inner class, which can be abstract, final, or private(as it is accessible inside outer class).