Eric Blake wrote:
So, which do we follow, Sun's behavior or specification? Behavior-wise,
Classpath is correct because it behaves identically to the JDK;
specification-wise, both libraries are in error by not accepting the
above program as legal, and the fix for Classpath would be simply
No, javac and jikes are correct. Similarly, it is possible for a
private field to hide a visible field:
class A {
public int i;
}
class B extends A {
private int i;
}
class C extends B {
void foo() {
// illegal, i is hidden in B, and A's i is not available
// i++;
}
}
Also, see
On Sun, 16 Sep 2001, Eric Blake wrote:
I just noticed the JDK 1.4 documentation for java.util.Hashtable claims
that Hashtable inherits the nested type Entry from Map:
http://java.sun.com/j2se/1.4/docs/api/java/util/Hashtable.html
This would mean that the following program should be legal,
I just noticed the JDK 1.4 documentation for java.util.Hashtable claims
that Hashtable inherits the nested type Entry from Map:
http://java.sun.com/j2se/1.4/docs/api/java/util/Hashtable.html
This would mean that the following program should be legal, and output
true:
import java.util.*;
class
4 matches
Mail list logo