17 lines
482 B
Java
17 lines
482 B
Java
// generics/ErasedTypeEquivalence.java
|
|
// (c)2016 MindView LLC: see Copyright.txt
|
|
// We make no guarantees that this code is fit for any purpose.
|
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
|
import java.util.*;
|
|
|
|
public class ErasedTypeEquivalence {
|
|
public static void main(String[] args) {
|
|
Class c1 = new ArrayList<String>().getClass();
|
|
Class c2 = new ArrayList<Integer>().getClass();
|
|
System.out.println(c1 == c2);
|
|
}
|
|
}
|
|
/* Output:
|
|
true
|
|
*/
|