In case of the integer, a copy of myInteger is used in the method, whereas passing an array, a copy of a reference to the object is used in the method. Therefore, since the reference (memories address) is pointing to the same reference/address, the array changes.
0 comments:
Post a Comment