What are generics in Java?

1 answers

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.

shilpigupta22 shilpigupta22 [Author] 4 months ago votes 0