publicstaticvoidmain(String[] args){ Demo1 demo1 = new Demo1(); Random random = new Random(); for (int i = 0; i < 10; i++) { int anInt = random.nextInt(100); demo1.push(anInt); } System.out.println(demo1.min());
for (int i = 0; i < 10; i++) { demo1.pop(); } System.out.println(demo1.min()); } }
publicstaticvoidmain(String[] args){ Demo2 demo1 = new Demo2(); Random random = new Random(); for (int i = 0; i < 10; i++) { int anInt = random.nextInt(100); demo1.push(anInt); } System.out.println(demo1.min());
for (int i = 0; i < 10; i++) { demo1.pop(); } System.out.println(demo1.min()); } }