🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8531

Re: Simple question for gurus ;)

#8531
From: Nikola Mitrovic
Date: Tue, 20 Mar 2001 10:05
76 lines
3099 bytes
Nope, won't work;

First, there is no method set, and there is no method .valueOf(int), so I
guess you must use .decode(String), or .parseInt(String). But guess, it
wont'k work then either!

Also, the same thing with String class doesn't work, and String is an
object, and can be easiliy assigned, concatenated, etc...

what I did more is to say

        test (Integer param) {
                Integer param2 = new Integer(5);
                param = param2;
        }

but it didn't work either, and it should since, it should be pointer
assignment...

plz, any working example?

"Stefan Adolfsson" <stefan.adolfsson@usa.net> wrote in message
news:3ab688c8.43123726@news.cs.umu.se...
> Use the integer as an object,,,
> instead of:
> int param ;
> do:
> Integer param;
> then the integer will work as an object which is changed directly in
> java and not copied.
> example:
>
> public void test(Integer param) { param.set(5);
> }
>
> public void example(){
>         Integer example_parameter = new Integer(0);
>         test( example_parameter );
>         System.out.println("parameter: " + example_parameter);
> }
>
>
>
>
>
> On Mon, 19 Mar 2001 21:29:30 +0100, "John Good"
> <dumster@collector.org> wrote:
>
> >
> >I've got a strange problem with Java, it's probably a feature, but please
> >point me to solving this.
> >
> >If I have something like:
> >
> >public void test(int param) { param = 5;
> >}
> >
> >and practically want to set the param to 5 (I do not want to use return,
> >please!), and when I call it from another method, like:
> >
> >public void example(){
> >        int example_parameter = 0;
> >        test( example_parameter );
> >        System.out.println("parameter: " + example_parameter);
> >}
> >
> >I'll get the 0 as the output, and I want 5; how to assign a value a
> >parameter? (pointers I miss you ;)
> >I've checked some books on that, but as allways its not in it, because
it's
> >"too obvious"...
> >
> >plz help :)
> >
> >
>
Technical Details
Message-ID: <2YFt6.4$mR5.423@psinet-eu-nl>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!not-for-mail
References: <Z_tt6.19$xH3.1481@psinet-eu-nl> <3ab688c8.43123726@news.cs.umu.se>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,a90669a07786d662
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-20 02:08:06 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!not-for-mail
From: "Nikola Mitrovic" <nikola@mail.com>
Newsgroups: borland.public.jbuilder.java.language
References: <Z_tt6.19$xH3.1481@psinet-eu-nl> <3ab688c8.43123726@news.cs.umu.se>
Subject: Re: Simple question for gurus ;)
Lines: 78
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <2YFt6.4$mR5.423@psinet-eu-nl>
Date: Tue, 20 Mar 2001 11:05:29 +0100
NNTP-Posting-Host: 195.114.201.103
X-Complaints-To: abuse@uk.psi.com
X-Trace: psinet-eu-nl 985082750 195.114.201.103 (Tue, 20 Mar 2001 10:05:50 GMT)
NNTP-Posting-Date: Tue, 20 Mar 2001 10:05:50 GMT
Organization: Connectivity but not content by PSINet