[28] in java-interest

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

syntax of "new"; packages

daemon@ATHENA.MIT.EDU (Jeremy Fitzhardinge)
Mon May 1 12:41:53 1995

From: jeremy@sour.sw.oz.au (Jeremy Fitzhardinge)
To: java-interest@java.Eng.Sun.COM
Date: Mon, 1 May 1995 15:15:27 +1000 (EST)

I've been running my compiler over the sources in classsrc to see
what breaks (which is surprisingly little (now)).

In browser/hotjava.java, it uses the syntax "new String[12]".  Is
this the same as "new String()[12]"?  It seems a little odd that
a new of just an object must have argument parens, even if empty,
but making an array of them doesn't explicitly require them.

I've also started playing with proper package management.  I'm
unsure where in the grammar it is legal to use a fully qualified
name.  Is it, for example, valid to do this:
package my.test;
class my.test.thing {	// OK to explicitly name?
	void my.test.thing.method() {}	// How about this?
}
// or this, in the same source file? (I doubt it)
class some.other.package.foo {
}

Is it possible for a class and a package to have the same name?
Is it meaningful to import a package (as opposed to all the
classes in a package)?

Thanks,
	J

-
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