Skip to main content

Practice ยท 3 of 3

Your own generic Box

Implement static class Box<T> with private T value, put(T), get(), isEmpty(), and static <T> Box<T> of(T value) factory. Also implement static <T extends Comparable<T>> T maxOf(java.util.List<T> items) using the bound.

Difficulty: beginner

Back to lesson: Practice: Practice: Collections at Work