Why use Generics in Java?

Generics add a way to specify concrete types to general purpose classes and methods that operated on Object before.   Code that uses generics has many benefits over non-generic code: 1. Stronger type checks at compile time(Compile-time type safety). A Java compiler applies strong type checking to generic code and issues errors if the code violates ...