Creating Superclasses and Subclasses

AP Computer Science A· difficulty 4/5

A subclass that declares a field with the same name as a superclass field

  • A

    Shadows the parent field (does NOT polymorphically dispatch)

    check_circle
  • B

    Inherits and replaces

  • C

    Compile error

  • D

    Hides parent's field permanently

Explanation

Fields are NOT polymorphic; reference type determines which field is accessed.

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

Related questions