Article View: borland.public.jbuilder.java.language
Article #19762Re: passing parameters to methods to get a value back (by reference in C++) and one other question
From: Eric Nagler
Date: Tue, 30 Dec 1997 00:00
Date: Tue, 30 Dec 1997 00:00
18 lines
1349 bytes
1349 bytes
On Tue, 30 Dec 1997 17:00:42 GMT, ait@concentric.net (Jeff Kish) wrote: >Can I do it? I am having a problem returning an integer value via a >public methods parameter. Can someone help me here? Is there such a >thing as by reference in Java? Do I need to force it to a string? Your question is vague. What are you trying to do? Return an 'int' by reference? It can't be done. And of course there are references in Java (as opposed to pointers). >How do assignments work if you don't define a copy constructor? In C++ there is no connection between an assignment and the invocation of a copy constructor. When you "assign" in Java, you are just making two references refer to the same heap-based object. Same principle for initialization.
Technical Details
Message-ID:
<34a9583d.11419067@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34a9282d.69646145@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,90bf066ce13115b3 X-Google-Attributes: gidf74b3,public From: 76711.521@compuserve.com (Eric Nagler) Subject: Re: passing parameters to methods to get a value back (by reference in C++) and one other question Date: 1997/12/30 Message-ID: <34a9583d.11419067@forums.borland.com> X-Deja-AN: 311417324 Content-Transfer-Encoding: 7bit References: <34a9282d.69646145@forums.borland.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: TeamB Newsgroups: borland.public.jbuilder.java.language