Java - ALWAYS shallow copy!


#1

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!


#2

Can you please ellaborate or share your code?