It's because you don't know Java or its calling semantics.

See inline.

>From: "unknown" <[EMAIL PROTECTED]>
>Subject: [jdjlist] a small question.
>Can you lemme know the output of the following program and THE REASON ???

See above... self starters have already started working it out.

>import java.lang.*;
>
>public class Myself
>{
>  public static void main(String args[])
>  {
>         Myself x = new Myself();
>         x.doIt();
>  }
>
>     void doIt()
>     {
>         int deepak = 10;
>         int returnInt = modifyIt(deepak);
>         System.out.println("Value is:: "+deepak);
>         System.out.println("returnString is:: "+returnInt);
>     }

You're passing a copy of deepak to modifyIt. The copy is modified, then put 
on the stack to be assigned to returnIt. The original is left unchanged.

>Thanks.

You're welcome for this tiny, tiny, tiny explanation of a well-known usage 
issue.


-----------------------------------------------
Joseph B. Ottinger       [EMAIL PROTECTED]
http://enigmastation.com          IT Consultant

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to