Article View: borland.public.jbuilder.java.language
Article #18110Re: VM question
From: David Young
Date: Thu, 06 Aug 1998 00:00
Date: Thu, 06 Aug 1998 00:00
33 lines
1401 bytes
1401 bytes
Both 'A' and 'B' are class REFERENCE variables. In your code you have only
one instantiated object, first referenced using 'A' then, after the B=A
code, by both 'A' and 'B'.
Fabrice Pati wrote:
> Just a little question concerning Java and how objects are allocated in
> memory:
>
> What happen with the snippet:
>
> "MyClass A = new MyClass();
> MyClass B;
>
> B = A;"
>
> Is B instantiated as if a "new myClass()" has occured ?
> or does the JVM just do a pointer copy ?
>
> Sorry for the newby question
>
> Fab
--
------------------------------------------------------------------------------
To thine own self be true. I am truly: David Young
W. Shakespeare dayoung@xmission.com &
day@icis-inc.com
------------------------------------------------------------------------------
Technical Details
Message-ID:
<35CA045B.BF01F4AB@icis-inc.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6p4on7$m8o7@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,1c3452b381a72b96 X-Google-Attributes: gidf74b3,public From: David Young <day@icis-inc.com> Subject: Re: VM question Date: 1998/08/06 Message-ID: <35CA045B.BF01F4AB@icis-inc.com> X-Deja-AN: 378608547 Content-Transfer-Encoding: 7bit References: <6p4on7$m8o7@forums.borland.com> To: Fabrice Pati <fpati@orli.fr> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language