Re: Question on nested types

2001-09-18 Thread Bryce McKinlay
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

Re: Question on nested types

2001-09-17 Thread Eric Blake
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

Re: Question on nested types

2001-09-17 Thread Erwin Bolwidt
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,

Question on nested types

2001-09-16 Thread Eric Blake
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