Errata in JLS (Overriding)?
Hi, I'm going through JLS Third Edition, page 227. In the first discussion is said that:
[quote]
It is a compile time error if a type declaration T has a member method m1 and there exists a method m2 declared in T or a supertype of T such that all of the following conditions hold:
a) m1 and m2 have the same name
b) m2 is accessible from T
c) The signature of m1 is not a subsignature of m2
d) m1 [...] has the same erasure as m2 [...]
[/quote]
I declared the following two classes:
/*
* C.java
*
* Created on 28 May 2007, 17:12
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package experiments;
/**
*
* @author mtedone
*/
publicclass C<T>{
/** Creates a new instance of C */
public C(){
}
T id (T x){
returnnull;
}
}
and
/*
* D.java
*
* Created on 28 May 2007, 17:13
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package experiments;
/**
*
* @author mtedone
*/
publicclass Dextends C<String>{
/** Creates a new instance of D */
public D(){
}
Object id (Object o){
returnnull;
}
}
But NetBeans doesn't produce any compile-time error.

