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 are exceptions — disruptions in normal program flow
  2. The exception hierarchy: ThrowableExceptionRuntimeException
  3. Checked vs unchecked exceptions — when the compiler enforces handling
  4. try-catch blocks
  5. finally block — guaranteed execution
  6. try-with-resources — automatic resource cleanup (intro, detailed in later weeks)
  7. throw — explicitly throwing an exception
  8. throws — declaring exceptions in method signatures
  9. Creating custom exception classes
  10. Best practices: don't catch Exception generically, meaningful messages
  11. Exercise: add error handling to an existing codebase

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.