Re: call by reference



Thank you all! That's exactly what i was saying, but they would just not
listen. I'l show them this on monday. We'll see.
"Chris Smith" <cdsmith@xxxxxxx> wrote in message
news:MPG.1d2fc52264ee6b3989a3e@xxxxxxxxxxxxxxxxxxx
> George Cherry <GWCherryHatesGreenEggsAndSpam@xxxxxxxxxxxx> wrote:
>> Chris, I'm afraid your example will give rosty the wrong
>> notion that a called method can't change an object
>> when you pass the method the value of a reference
>> variable referring to the object?
>
> Only if rosty doesn't understand what's going on... which he said he
> did. The point is that assigning to the formal parameter does not
> affect the value of the actual parameter. In your code:
>
>
>> private static void change(int[] a) {
>> a[0] = 4;
>> a[1] = 5;
>> a[2] = 6;
>> }
>
> In this case, you never assign to the formal parameter, so it doesn't
> even matter if the parameter passing is by reference or by value. The
> parameter just happens to identify some shared state, and you've
> modified the shared state. This is exactly the same situation as my
> "example 2" in the original post, and it doesn't demonstrate pass by
> reference.
>
> --
> www.designacourse.com
> The Easiest Way To Train Anyone... Anywhere.
>
> Chris Smith - Lead Software Developer/Technical Trainer
> MindIQ Corporation


.



Relevant Pages

  • Re: call by reference
    ... > variable referring to the object? ... In this case, you never assign to the formal parameter, so it doesn't ... even matter if the parameter passing is by reference or by value. ... parameter just happens to identify some shared state, ...
    (comp.lang.java.programmer)
  • Followup on TECH: Gottlieb System 1 - Genie Coin Door issues
    ... here is a little "Problem Resolution Report" for Chris ... Hopefully this will be one to add to your already vast reference ... I worked on his game last night... ... Verify continuity at midpoint cabinet connector, ...
    (rec.games.pinball)
  • Re: is there any principle when writing python function
    ... What you have, I think, is a module named Cerutti, in which you have a ... you are referred to as Neil; and outside ... Cerutti.Neil is the cleanest way to reference you. ... Chris Angelico ...
    (comp.lang.python)
  • Re: 2 Files open - Paste to One
    ... That is the point Chris. ... set a reference to it and use that ... Dim sName as String ... This code errors on the set bk line. ...
    (microsoft.public.excel.programming)
  • Re: Need to know player install stats
    ... reference would be the IDC or Nielsen NetRatings reports. ... "Chris" wrote in message ... > I'm afraid I don't see any reference to WMP stats on this ... >>> stats for versions of Windows Media Player? ...
    (microsoft.public.windowsmedia.player)