-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.java
24 lines (19 loc) · 836 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.stacks;
public class Main {
public static void main(String[] args) {
ArrayStack stack = new ArrayStack(10);
stack.push(new Student("Saon", "Sikder", 2502));
stack.push(new Student("Sakib", "Al Hasan", 2505));
stack.push(new Student("Md", "Muaz", 2517));
stack.push(new Student("Momenatul", "Islam", 2522));
stack.push(new Student("Anamul", "Haq", 2523));
stack.printStack();
System.out.println("Size of this Stack: " + stack.size());
System.out.println("Popped item: " + stack.pop());
stack.printStack();
System.out.println("Size of this Stack: " + stack.size());
System.out.println("Peeked item: " + stack.peek());
stack.printStack();
System.out.println("Size of this Stack: " + stack.size());
}
}