← Exit to Module 12: Generics and Type Safety lessons
Module progress · 0%Lesson · 30 min
Module 12: Generics and Type Safety
Lesson focusMini-Project: Generic Data Structure
Implement a generic cache or queue with bounded type parameters and Optional results.
01 · 12 minWhy Generics?Locked02 · 16 minGeneric Classes & InterfacesLocked03 · 15 minGeneric MethodsLocked04 · 18 minBounded Type ParametersLocked05 · 16 minWildcards & VarianceLocked06 · 14 minType Erasure & LimitationsLocked07 · 30 minMini-Project: Generic Data StructureLocked
Build a FixedSizeQueue<T> with enqueue/dequeue, iterators, and Optional peek methods.
Add bounded type parameters or comparator injections for prioritized variants.
Write unit tests for type safety, ensuring the API prevents misuse at compile time.