Why generics are used in java?



Why generics are used in java?..

Answer / Rajeev Kumar Malik

Generics are used in Java to provide type safety and improve performance by avoiding explicit type casting. They allow the creation of reusable classes and methods that can work with multiple data types.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What do you mean by exception handling in Java?

1 Answers   Atos Origin,


What is use of super keyword in java?

1 Answers  


What are the advantages of encapsulation in java?

1 Answers  


Why a dead thread occurs?

1 Answers  


What is the purpose of void?

1 Answers  


What releases of Java technology are currently available? What do they contain?

1 Answers  


What JNDI(Java Naming and Directory Interface) provides?

4 Answers  


What is the difference between Access Modifier and Access specifier?

1 Answers  


How is hashset defined in java?

1 Answers  


What is the difference between equals() and == in java?

0 Answers  


Java violates few objected oriented concepts. Can you explain in what way?

3 Answers   Ness Technologies,


What is difference between string and new string?

1 Answers  


Categories