This program doesn't compile:
abstract class A {
abstract <S,A extends S, B extends S> S method(A la, B lb);
void m2() {
Object o1 = method(Integer.valueOf(1), "32");
Object o2 = method(1, "32");
}
}
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode)
Test.java:5: <S,A,B>method(A,B) in A cannot be applied to (java.lang.Integer,java.lang.String)
Object o1 = method(Integer.valueOf(1), "32");
^
Test.java:6: <S,A,B>method(A,B) in A cannot be applied to (int,java.lang.String)
Object o2 = method(1, "32");
^
2 errors
###@###.### 2005-06-10 19:37:53 GMT
See http://forum.java.sun.com/thread.jspa?threadID=635048&tstart=0
###@###.### 2005-06-10 19:38:28 GMT