John Jai wrote:ba[0] and ba[1] both holds the reference b1 which has its size set as 4 in the go() method.
When Box[] ba = go(b1, new Box(6)); reaches the go method the value contained is 5 and 6
then b1.size becomes 4,and b2 remains 6
this is placed in an array ma wer b2,b1 contains 6,5
then ma and ba shares the same array object.
here ba[0] is assigned to b1 which is 4
so this prints 4,4
am i right??
correct me if i am wrong..
thanks in advance