Creating Superclasses and Subclasses

AP Computer Science A· difficulty 4/5

A subclass can access parent's <code>private</code> fields

  • A

    Via reflection

  • B

    Cannot access at all

  • C

    Only through inherited public/protected methods

    check_circle
  • D

    Directly

Explanation

Private fields are not directly accessible to subclasses; use getters/setters.

Want 10 more like this — adaptive to your weak spots?

Related questions