making a copy of a list java code example
Example 1: java copy list
List<Object> copy = new ArrayList<>();
copy.addAll(originalList);
Example 2: java copy list
List<Object> copy = new ArrayList<>(original_list);
List<Object> copy = new ArrayList<>();
copy.addAll(originalList);
List<Object> copy = new ArrayList<>(original_list);