Programming, Object Oriented, Java.
method public void print(Collection<String> collection) { for (String s : collection) { System.out.println("s = " + s); } } Passing an ArrayList Collection<String> collection1 = new ArrayList<>(); collection1.add("A"); collection1.add("D"); collection1.add("B"); collection1.add("C");