Examveda
Examveda

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

C. It reduces the size of collections

D. It allows collections to store any type of elements

Answer: Option B


This Question Belongs to Java Program >> Generics In Java

Join The Discussion

Related Questions on Generics in Java