[35] in java-interest

home help back first fref pref prev next nref lref last post

Re: packages

daemon@ATHENA.MIT.EDU (Peter Kessler)
Tue May 2 12:32:44 1995

Date: Tue, 2 May 1995 08:57:05 -0700
From: pbk@wombat.Eng.Sun.COM (Peter Kessler)
To: java-interest@java.Eng.Sun.COM

> 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 (:-).

			... peter

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post