Examveda

In Java generics, what is the purpose of the `Pair` class?

A. To define a generic interface

B. To implement a generic exception

C. To represent a generic collection

D. To store a pair of values with different types

Answer: Option D


This Question Belongs to Java Program >> Generics In Java

Join The Discussion

Related Questions on Generics in Java