What is the use of generics in Java?
Generics allow classes and interfaces to be a type for the definition of new classes in java which enables stronger type checking. It also nullifies the probability of type mismatch of data while insertion.
🔗Reference: stackoverflow.com
🔗Source: Java Interview Questions and Answers