Here is a method that prints the elements of a set. How can we make it print elements of any collection?
public static void printElements(Set<String> elements) {
for (String element : elements) {
System.out.println(element);
}
}
What can we use instead of Set to make it possible to print elements stored in Set's and List's?