Generics let you write classes, interfaces, and methods that work with a type parameter specified by the caller — providing compile-time type safety and eliminating casts. They power the Collections Framework and reusable libraries.
The problem generics solve
();
list.add();
list.add();
(String) list.get();
List<String> list = <>();
list.add();
list.add();
list.get();
