Solution:
Generics are a mechanism that enables types to be parameters of the class, interface or method definition. This mechanism allows reusing of the same code with different inputs, while providing compile-time checks.
Credit: 3870