(OCP) Oracle Certified Professional Practice Test
OCP Generics and Collections Questions and Answers
Which of the following statements is true regarding the behavior of generics in Java at runtime?
Select your answer
A
Generic type information is discarded by the compiler through a process called type erasure.
B
The JVM maintains a separate class file for each specific instantiation of a generic type.
C
Runtime reflection can be used to determine the exact parameterized type of a generic collection.
D
A `List` and a `List` are treated as distinct types by the JVM, preventing runtime casting errors.
Hint