[1082] in java-interest

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

Re: Type names and class names ..

daemon@ATHENA.MIT.EDU (Jeremy Fitzhardinge)
Fri Aug 18 03:32:13 1995

From: "Jeremy Fitzhardinge" <jeremy@suede.sw.oz.au>
Date: Fri, 18 Aug 1995 14:36:46 -0500
In-Reply-To: Mimir Reynisson <skelmir@brs.is>
        "Type names and class names .." (Aug 17, 10:02pm)
To: Mimir Reynisson <skelmir@brs.is>
Cc: java-interest@java.sun.com

On Aug 17, 10:02pm, Mimir Reynisson wrote:
> Subject: Type names and class names ..
>
> Yuck .. the following java code compiles quite happily under the
> Windows NT alpha 2 version. Please tell me this is only because of
> the hand coded parser, and that this really shouldn't be allowed.
>
> {
>     int Object;
>     Object = 0;
>     Object a;
>     a = null;
> }
>
> This in my not so humble opinion is ugly and not to mention
> confusing.

I'm not quite sure what you think is confusing there: the fact that you
can call variables "Object" or that variables and types are in different
namespaces.

The former is correct Java: the real name of Object is java.lang.Object,
so you can have other things called "Object", but their full names won't
be java.lang.Object.

I don't know about the latter.  My compiler will complain, since
"Object a;" will bind Object to "int Object" and find there's a type
error
(tt.java:  7: error: "Object" is not a named type).

	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