OnJava8-Examples/typeinfo/GenericClassReferences.java

13 lines
405 B
Java
Raw Normal View History

2015-06-15 17:47:35 -07:00
//: typeinfo/GenericClassReferences.java
// <20>2015 MindView LLC: see Copyright.txt
public class GenericClassReferences {
public static void main(String[] args) {
Class intClass = int.class;
Class<Integer> genericIntClass = int.class;
genericIntClass = Integer.class; // Same thing
intClass = double.class;
// genericIntClass = double.class; // Illegal
}
} /* Output: (None) *///:~