Multiple choice technology programming languages

Are private class-level variables inherited?

  1. No, and they are not accessible

  2. Yes, but they are not accessible

  3. May be

  4. I don't know.

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

Private class-level variables ARE inherited by subclasses in OOP, but they are NOT directly accessible. They exist in the subclass's memory layout but cannot be accessed by name - this is called 'inherited but not accessible'. Private members are only accessible within the class that declares them.