Skip to content

Commit 0f02e2a

Browse files
Stack and Vector
1 parent 5f09e85 commit 0f02e2a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
1.07 KB
Binary file not shown.

src/TheStack.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.Stack;
2+
3+
public class TheStack {
4+
5+
public static void main(String[] args) {
6+
Stack<Integer> chips = new Stack<>();
7+
chips.push(1);
8+
chips.push(2);
9+
chips.push(3);
10+
11+
System.out.println(chips.search(1));
12+
System.out.println(chips.peek());
13+
System.out.println(chips.pop());
14+
System.out.println(chips.pop());
15+
System.out.println(chips.peek());
16+
System.out.println(chips.empty());
17+
System.out.println(chips.search("funk"));
18+
}
19+
}

0 commit comments

Comments
 (0)