Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
The compiler generates both a warning and an error on this program: class Outer<T extends Number & Comparable<String>> { void foo(T t) { Comparable<Integer> ci = (Comparable<Integer>) t; } } Outer.java:3: warning: [unchecked] unchecked cast found : T required: java.lang.Comparable<java.lang.Integer> Comparable<Integer> ci = (Comparable<Integer>) t; ^ Outer.java:3: inconvertible types found : T required: java.lang.Comparable<java.lang.Integer> Comparable<Integer> ci = (Comparable<Integer>) t; ^ 1 error 1 warning
|