Relates :
|
|
Relates :
|
This program no longer compiles in JDK 7: import java.util.*; interface A { List<Number> getList(); } interface B { List getList(); } interface AB extends A, B {} class Test { void test(AB ab) { Number n = ab.getList().get(1); //error here } } OUTPUT: Test.java:17: error: incompatible types Number n = ab.getList().get(1); ^ required: Number found: Object 1 error
|