import java.util.Random; public class Lab31 { public static void main(String args[]) { MyList list1 = new MyStack(100); MyList list2 = new MyQueuee(100); Random rnd = new Random(12345); for (int k = 1; k <= 20; k++) { int rndInt = rnd.nextInt(20) + 10; addData(list1,rndInt); addData(list2,rndInt); } showData(list1,list2); System.out.println(); for (int k = 1; k <= 5; k++) { removeData(list1); removeData(list2); } showData(list1,list2); System.out.println(); } public static void addData(MyList l1, int x) { l1.add(x); } public static void removeData(MyList l1) { l1.remove(); } public static void showData(MyList l1, MyList l2) { System.out.println(l1); System.out.println(l2); } }