Lesson 5 of 716 minModule progress 0%

Module 12: Generics and Type Safety

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.

Advertisement

Lesson check

When should you use `List<?>`?

Next lesson →