Week 2

Inheritance

Abstract Classes

Interfaces

Polymorphism

Error Handling in Java

Practice

Assignment

Back end Track

Under construction

<aside> 🚧

This page is currently under construction. Please check back later.

</aside>

Implementation plan:

  1. What is an abstract class
  2. abstract keyword on class and method level
  3. Abstract methods — declared without implementation
  4. Concrete methods in abstract classes — providing shared behavior
  5. Cannot instantiate abstract classes
  6. Subclasses must implement all abstract methods (or also be abstract)
  7. When to use abstract classes — shared state + partial implementation
  8. Exercise: refactor the previous hierarchy to use an abstract base class

The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0

CC BY-NC-SA 4.0 Icons

*https://hackyourfuture.net/*

Found a mistake or have a suggestion? Let us know in the feedback form.