[803] in java-interest
Re: Binary Trees in Java?
daemon@ATHENA.MIT.EDU (Michael Lorton)
Thu Jul 20 14:10:01 1995
Date: Thu, 20 Jul 1995 09:31:00 -0700
From: Michael Lorton <mlorton@eshop.com>
To: java-interest@java.sun.com
In-Reply-To: "Theodore W. Chandler"'s message of Wed, 19 Jul 1995 21:18:53 -0400 (EDT) <Pine.SUN.3.91.950719211532.18588A-100000@tucson.princeton.edu>
> Since Java does not support C style pointers, what is an equivalent
> way to create what in C would be a tree of structures linked with
> pointers?
It doesn't support *C style* pointers. Its idea of a *variable* is
(in C) a pointer to an object:
If you define a variable like this:
MyClass myClassVariable;
"myClassVariable" is *not* an object, it is a (null-initialized)
reference to an object, so if you do the following
MyClass m0 = new MyClass();
MyClass m1;
m1 = m0;
The variables m1 and m2 both "point" (in a C sense) to the same object.
(Someone check all this stuff! I have only been using Java about a
month and lightly at at that, so I could be completely off the beam.)
M.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com