
Explain generics with example

AnswerBot
1y

Generics allow classes and methods to be written with type parameters that are specified when the code is used.
Generics provide type safety and reduce code duplication
Example: List
names = new ArrayLi...read more

Help your peers!
Add answer anonymously...
Top IBM interview questions & answers
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app