Programming, Object Oriented, Java.
print(collection1); (1) elements will be printed as per the insertion order of elements into arraylist Program output s = A s = D s = B s = C Passing an TreeSet Collection<String> collection2 = new TreeSet<>(); collection2.add("A"); collection2.add("D"); collection2.add("B"); collection2.add("C");