import java.util.ArrayList; import java.util.Collection; public class MainClass { public static void main(String[] argv) { Collection collection1 = new ArrayList(); collection1.add("1"); Collection collection2 = new ArrayList(); collection2.add("2"); collection1.addAll(collection2); System.out.println(collection1); } }
[1, 2]