Notes about Subclasses


In subclasses we can inherit members as is, replace them, hide them, or supplement them with new members:
  • The inherited fields can be used directly, just like any other fields.

  • We can declare new fields in the subclass that are not in the superclass.
Review: Inheritance Concepts
    Which statement is NOT true about Java inheritance?

      A subclass does not inherit the private members of its parent class.
      Every class, except the Object class, has one and only one direct superclass.
      Java supports multiple inheritance with classes.
      The constructor of the superclass can be invoked from the subclass.
        Result:



      You don’t need a parachute to go skydiving.    
      You need a parachute to go skydiving twice.