import java.util.*; public class StudentCollection { public static void main(String args[]) { Collection students = new ArrayList<>(); students.add(new Student("John", "Smith")); students.add(new Student("Stanley", "Peters")); students.add(new Student("Edgar", "Bloch")); students.add(new Student("Suzan", "Miles")); students.add(new Student("Mary", "Poppins")); Collection sts = new LinkedList(); sts.add(new Student("John", "Smith")); sts.add(new Student("Stanley", "Peters")); students.addAll(sts); print(students); } public static void print(Collection collection) { Iterator it = collection.iterator(); while(it.hasNext()) System.out.println(it.next()); } }