Java Arena

Module 34

Inheritance and abstract classes

Classes built on other classes. The class Object that every class inherits from, extends and what a subclass gets, constructors that call super(...), overriding a method with @Override and reusing the parent's version with super, private, protected and public as a subclass sees them, why the object's own class decides which method runs, when inheritance fits ("is a") and when an instance variable does ("has a"), and abstract classes with abstract methods. MOOC section 9.1.

Steps

  1. Every class inherits from Object
  2. extends: a class built on another
  3. Constructors and super(...)
  4. Overriding methods: @Override and super
  5. private, protected and public in a subclass
  6. The object's class decides which method runs
  7. When to inherit: is a, or has a?
  8. Abstract classes and abstract methods