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

Join The Discussion