Last Updated: June 6, 2026
Generic types in Java are stricter than they first appear. A List<Product> is not a List<Object>, even though Product is an Object, and that often surprises newcomers. Wildcards (<?>, <? extends X>, and <? super X>) are how Java lets you write flexible APIs without breaking the type safety that generics are built to protect. This lesson covers why generics are invariant, what each wildcard form means, and the PECS rule that picks between them.