Inheritance

  • different classes can have methods and attributes unique to them
  • extends can inherit the same methods and attributes and also some unique to themselves

Superclass

  • parent class
  • contains the basic attributes

Subclass

  • attributes of subclass same as superclass if nothing changed
    • add additional assignment if new
  • use super to access the superclass constructor with subclass

Overriding method

  • same parameter in subclass overrides the parent class

Polymorphism

  • override in many different subclasses
  • two different implementations through overriding methods
    • runtime polymorphism or dynamic binding or dynamic method dispatch
  • single method used different ways
    • method overloading or compile time polymorphism or static polymorphism

Object Superclass

  • toString method
    • prints attributes
    • converts string object into string
  • equals method
    • compares two strings