1Z0-804 · Question #33
Which concept allows generic collections to interoperate with java code that defines collections that use rawtypes?
The correct answer is E. type erasure. The type erasure of its leftmost bound, or type Object if no bound was specified. type parameters type erasure List<String> List Map.Entry<String,Long> Map.Entry <T extends Cloneable & Comparable<T>> Cloneable <T extends Object & Comparable<T>> Object <T> T[] toArray(T[] a)…
Question
Which concept allows generic collections to interoperate with java code that defines collections that use rawtypes?
Options
- Abytecode manipulation
- Bcasting
- Cautoboxing
- Dauto-unboxing
- Etype erasure
How the community answered
(36 responses)- A3% (1)
- B3% (1)
- C14% (5)
- D6% (2)
- E75% (27)
Explanation
The type erasure of its leftmost bound, or type Object if no bound was specified. type parameters type erasure List<String> List Map.Entry<String,Long> Map.Entry <T extends Cloneable & Comparable<T>> Cloneable <T extends Object & Comparable<T>> Object <T> T[] toArray(T[] a) Object[] toArray(Object[] a) The type erasure process can be imagined as a translation from generic Java source code back into regularJava code. In reality the compiler is more efficient and translates directly to Java byte code. But the byte codecreated is equivalent to the non-generic Java code.
Topics
Community Discussion
No community discussion yet for this question.