Java - ALWAYS shallow copy!


If you’re using Java ArrayLists and you want to overwrite one ArrayList with the contents of another, ALWAYS ALWAYS ALWAYS shallow copy (i.e. use clone() method)!!
took me over 3 hours to figure out that’s what was wrong with my program!


Can you please ellaborate or share your code?