+ 6
// Create a shallow copy, an easy way : ArrayList<String> list = new ArrayList<String>(); list.add("Solo"); list.add("Learn"); list.add("Play"); System.out.println("Original Array: " + list + " "); ArrayList<String> copy = new ArrayList<>(list); System.out.println("Copied Array: " + copy + " ");
24th Dec 2017, 5:44 AM
Dev
Dev - avatar