When you call the clone() method of an ArrayList, a shallow copy of the list is created. what is shallow copy of array?
If you have references in the ArrayList, the same references will be copied into the cloned ArrayList. The objects will not be cloned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With