[1764] in java-interest

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

Re: linked list w/o references or ptrs?

daemon@ATHENA.MIT.EDU (Frank Greco)
Sat Sep 16 11:40:36 1995

Date: Fri, 15 Sep 95 13:59:58 EDT
From: fgreco@lehman.com (Frank Greco)
To: John Barton <jjb@watson.ibm.com>
Cc: java-interest@java.sun.com

> >As a response to a question on doing pointer-ish things in Java without
> >pointers, someone had posted some code to implement a linked-list.
> >
> >Anyone have this code handy?
> 
>  In code I have seen it looks like every java variable *is*
> a pointer.  Isn't this true:
>         java    ->    C/C++
>         ----          ---
>          X x;         X *x;
>          x.f();       x->f();

As far as I know, this is correct.  Formally speaking, there are no
pointers in Java (despite the implementation).  You're supposed to
think of objects in Java as having "references", not pointers.

But what happens if you pass an object to a method?  Are you passing
by reference or by value?  If by reference, how does one pass by value?

Frank
-
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