[168] in java-interest
non-public classes in packages
daemon@ATHENA.MIT.EDU (bert hobbs)
Thu Jun 1 14:47:56 1995
Date: Thu, 1 Jun 1995 11:22:08 -0700
From: bhobbs@sfhill.sfhill.org (bert hobbs)
To: java-interest@java.Eng.Sun.COM
I tried to define an ApplyButton class in following code:
package X;
import awt.*;
import browser.*;
class X extends Object {
public X() {
new ApplyButton(this);
}
}
class ApplyButton extends Button {
private X x;
public ApplyButton(X x) {
super(null,null,(Window)null);
}
}
I get the compiler error:
"Ambiguous class: browser.ApplyButton and X.ApplyButton"
If I take the package statement out I get the compiler errors:
"Invalid method declaration, return type required"
and
"Can't access class ApplyButton. Only public classes and interfaces in other packages can be accessed"
If browser.ApplyButton is not public why should the importing
browser.* cause a name conflict?
bert
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com