This Java code shows how a shallow copy of an array is made when passing it to a constructor, so that changes to the original array are reflected in the copy, demonstrating that only a reference and not the array itself was copied.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
19 views1 page
Shallow
This Java code shows how a shallow copy of an array is made when passing it to a constructor, so that changes to the original array are reflected in the copy, demonstrating that only a reference and not the array itself was copied.