Java Learner logo
← Exit to Module 12: Generics and Type Safety lessons
Module progress · 0%Lesson · 16 min

Module 12: Generics and Type Safety

Lesson focus

Wildcards & Variance

Express flexible APIs with wildcard types.

Use unbounded wildcards (List<?>) for read-only access when type doesn’t matter.

Combine extends/super wildcards with PECS guidelines to maintain type safety.

Capture wildcards via helper methods when you need to mutate generic structures internally.

Lesson quiz

When should you use `List<?>`?

Next lesson →