Multiple choice technology programming languages

Can a subclass access the private values of the super class

  1. No

  2. Yes

  3. Will have to use an instance

  4. None

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

Private members of a superclass are NOT accessible in subclasses. This is a fundamental principle of encapsulation in Java - private access means class-level only. Even though subclasses inherit the parent, they cannot directly access private fields or methods. They must use public/protected getters or setters if available. Option A 'No' is correct.