import java.util.ArrayList;
import java.util.List;
public class MainClass {
public static void printList (List> list) {
for (Object element : list) {
System.out.println(element);
}
}
public static void main(String[] args) {
List list1 = new ArrayList();
list1.add ("Hello");
list1.add ("World");
printList (list1);
List list2 = new ArrayList();
list2.add(100);
list2.add(200);
printList(list2);
}
}
Hello
World
100
200