Anil Philip
Posts: 19
Nickname: anilphilip
Registered: Nov, 2002
|
|
Re: cannot access: package--->default
|
Posted: Nov 22, 2002 5:44 AM
|
|
If it is a feature, then it is a little-known feature, because I did not find it in the book!
Yes, this was temporary. I developed the server side classes in the default package (for now, while still developing).
I was trying to use this in some client side classes which I had earlier put into a package.
Anyway, I have put TaskException and the server side stuff into its package.
thanks for the replies! Anil
> You discovered a feature of Java. You can't import > anything from the unnamed package into any other package. > So if you want to use a type in other packages, you must > put that type in a named package. > > I use the unnamed package only on rare occasions. It is > just kind of convenient to use it for simple apps. For > example, a couple of days ago I wrote a simple JDBC app > that clears out watches in this forum's database if they > threads have had no activity for 30 days. It may have 25 > lines of code in the main method, and isn't used as an > API, so I just left it in the unnamed package. Any package > you want to use as an API, to offer types to other > packages, you'll need to put into a named package.
|
|