[36] in java-interest
Re: packages
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Tue May 2 12:53:24 1995
Date: Tue, 2 May 1995 09:39:00 -0700
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: java-interest@java.Eng.Sun.COM
Hi Peter,
> > From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
> > Date: Mon, 1 May 1995 09:52:11 -0700
> > Subject: Re: syntax of "new"; packages
> >
> > > From: jeremy@sour.sw.oz.au (Jeremy Fitzhardinge)
> > > Date: Mon, 1 May 1995 15:15:27 +1000 (EST)
> > > Subject: syntax of "new"; packages
> > >
> > > Is it possible for a class and a package to have the same name?
> >
> > Unfortunately yes. This makes allows for possible confusion between
> > package and class names. However, packages are never explicitly
> > refered to, so it really isn't a problem.
>
> I've found the `confusion' between package and class names useful when
> implementing `nested' classes. E.g. I might have
>
> package Stuff;
> public class Outer { .... }
>
> and
>
> package Stuff.Outer;
> public class Inner { .... }
>
> The compiler seems happy with it. I didn't ask if it was legal, because I
> didn't want anyone to say it wasn't (:-).
It is legal, but confusing. B^)
Have fun,
Arthur van Hoff (avh@eng.sun.com)
http://java.sun.com/people/avh/
Sun Microsystems Inc, M/S UPAL02-301,
100 Hamilton Avenue, Palo Alto CA 94301, USA
Tel: +1 415 473 7242, Fax: +1 415 473 7104
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com