Article View: borland.public.jbuilder.java.language
Article #7169Re: Altering data with a method call
From: Michael Rachow
Date: Sun, 08 Jul 2001 17:21
Date: Sun, 08 Jul 2001 17:21
28 lines
1890 bytes
1890 bytes
Hi David, What is passed is passed by value, thats right. But for objects (instances of classes) the reference to the object is passed so by using that reference you are able to manipulate the object. What you can't modify to the outside are build-in (primitive) types like int or boolean. Here the values themselfs are passed by value and so .. you know. If you would like to manipulate "simople" vaule you have to use the wrapper classes of these primitve types (Integer or Boolean) Regards Michael David Chandler <davidschandler@netzero.net> schrieb in im Newsbeitrag: 3B4812BB.F35B508E@netzero.net... > I am moving from Pascal to Java. In Pascal you could pass either values or > variables to a procedure. Variables get altered so the revised data gets > passed back. Java allows you to pass only values. I can get a single > return value, but what if I want a method to alter other variables? Do I > have to rely on globals? > > What is the usual practice here? > > -- > David Chandler > >
Technical Details
Message-ID:
<3b4895f6_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!194.213.69.151!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnewsReferences:
<3B4812BB.F35B508E@netzero.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,1c0aad99b07f6335 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-07-08 10:21:39 PST From: "Michael Rachow" <michael@famrachow.de> Newsgroups: borland.public.jbuilder.java.language References: <3B4812BB.F35B508E@netzero.net> Subject: Re: Altering data with a method call Date: Sun, 8 Jul 2001 19:21:54 +0200 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 NNTP-Posting-Host: 217.227.20.36 Message-ID: <3b4895f6_2@dnews> X-Trace: dnews 994612726 217.227.20.36 (8 Jul 2001 10:18:46 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!194.213.69.151!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews