Difference Between Shallow vs Deep Copy of Objects in Java
1.0 Overview We will discuss the differences between a Shallow and Deep copy of a Java Object in this article. 2.0 Shallow Copy of an Object For an example let’s consider the ShoppingCart class defined here. It has an instance variable to hold a string variable as cartName and an ArrayList object to hold a… Read More Difference Between Shallow vs Deep Copy of Objects in Java