Vidyalelo
Java Programming · Q4

Java Generics

Programming · Java Programming · question 4

Q4

What is the benefit of using generics with collections in Java?

A.
It allows collections to store any type of elements
B.
It ensures type safety by allowing only specific types of elements
Answer
C.
It reduces the size of collections
D.
None of These

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board