Originally posted by sindura kapur:
according to me the output of following code
should be 10 10 BUT ACTUALLY IT IS 0 10.can anyone explain me how and why is that output changes b but not a?
[HENRY: Added code tags]
[ July 26, 2008: Message edited by: Henry Wong ]
[ July 27, 2008: Message edited by: gebuh Boose ]
Originally posted by Henry Wong:
When I first saw this link, I got very nervous, till I read it. This whole thing of "pass by reference" vs "pass by value" is annoying because people don't understand what the terms mean. As the link states, Java is only pass by value, there is no pass by reference, although, you can simulate it by putting your variables in a class.