See http://forum.java.sun.com/thread.jsp?forum=316&thread=496028
The following program fragment fails to compile
void f(List<Integer> li, List<String> ls) {
if (li.getClass() == ls.getClass())
;
}
because the intersection of Class<List<Integer>> and Class<List<String>> is
empty.
The following program fragment fails to compile
void f(List<Integer> li, List<String> ls) {
if (li.getClass() == ls.getClass())
;
}
because the intersection of Class<List<Integer>> and Class<List<String>> is
empty.
- relates to
-
JDK-6184881 Object.getClass() typing rule could be improved
-
- Open
-