Skip to content

Try “polymorphism”, “TCP handshake” or “git rebase”.

    Exceptions and Generics

    Handle failure properly with exceptions, and write code that works for any type with generics and type erasure.

    • Module 5 of 11
    • Intermediate
    • 10 chapters
    • 47 min

    Real programs fail, and good ones fail clearly. Generics let one piece of code work for any type safely — you will use both on nearly every page of Java.

    What you will be able to do

    • Handle errors with try, catch, finally and try-with-resources
    • Choose between checked and unchecked exceptions
    • Write generic classes and methods with bounds
    • Explain type erasure and when to use wildcards

    Chapters

    Extras