# Quick notes on generics and type bounds

Here are a few resources on generics and type bounds:

A long page from JournalDev
The page starts with a basic introduction to generics

There are some useful examples of how wildcards work and why we need them, e.g. to write a function like

double sum(List<? extends Number> list) {}
and then call sum on a List<Integer> or List<Double>.
The article also discusses type erasure, which is a little bit more advanced. TL;DR: You can’t really cast to a generic type (like (T) obj) or use instanceof with a generic type.
An even longer tutorial from Oracle
This might make a good complement to the slides. The pages in the linked tutorial cover everything in the slides, and then some. Given your time constraints before the exam, you could maybe skim over this tutorial, but I don’t think it’s worth reading in detail (maybe later, when you’re programming and really need the detailed info).