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 interface — a contract
  2. Defining an interface with method signatures
  3. implements keyword
  4. A class can implement multiple interfaces
  5. Default methods in interfaces (Java 8+)
  6. Static methods in interfaces
  7. Interfaces vs abstract classes — when to use which
  8. Interface segregation — keeping interfaces small and focused
  9. Real-world examples: Comparable, Iterable
  10. Exercise: define an interface and implement it in multiple classes

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.