Challenge 1: Comparing getClass() Across Type Arguments — Possible Solution ==================================================================== ErasureDemo.java: import java.util.ArrayList; import java.util.List; public class ErasureDemo { public static void main(String[] args) { List strings = new ArrayList<>(); List doubles = new ArrayList<>(); // Both getClass() calls return java.util.ArrayList -- the SAME // Class object -- even though the declared type arguments // (String vs Double) are completely different. This is type // erasure in action: by the time the class is loaded and // running, there is no such thing as "ArrayList" or // "ArrayList" anymore -- only ArrayList. The type // argument only ever existed for the compiler's own // compile-time checking and was discarded afterward. System.out.println(strings.getClass() == doubles.getClass()); } } Output: true WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates the chapter's own opening example directly and the comment explains the result using the chapter's own core claim: one shared runtime class regardless of the type argument used at the declaration site.