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

Module 12: Generics and Type Safety

Lesson focus

Mini-Project: Generic Data Structure

Implement a generic cache or queue with bounded type parameters and Optional results.

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.

Lesson quiz

What benefit should the mini-project demonstrate?

Next lesson →