Yasin Kothia wrote:Your thinking one value is passed because the code is only printing the 'height'.
If you want the width, use which will = 5.
if you want to modify it, you will need to edit the modify method, so for e.g.
Both values are passed not just one, only one is printed out.
SCJP
Visit my download page
Those two statements, which I think are quoted an earlier post, seem to contradict each other. I don’t think the quote is actually wrong, however. That was a confusing statement; where does it come from? I have already asked for the source.Kalpana Periasamy wrote: . . . for object reference variables, the called method can change the object the variable referred to. . . .
For object references, it means the called method can't reassign the caller's original reference variable and make it refer to a different object, or null."
. . .
Kalpana Periasamy wrote: . . . for object reference variables, the called method can change the object the variable referred to. . . .
Let me rephrase this sentence for better understanding. For object reference variables, the called method can change the contents of the object(referred by the variable). This is what I understood.
Campbell Ritchie wrote:The bit about not altering the reference but altering its contents is part of “pass-by-value”. If you could alter the reference, that would be “pass-by-reference”, which C++ supports and C mimics, but Java™ neither mimics nor supports. There is a long discussion about “pass-by-value” here. Read that and see whether it helps you
![]()
By the way: where did you find that paragraph. You should always quote sources.
Please be more specific. That term “SCJP” links automatically to our FAQ, which that is not a quote from.kiruthigha rajan wrote: . . . this is from SCJP 1.6
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |