There was an error while loading. Please reload this page.
1 parent 5f09e85 commit 0f02e2aCopy full SHA for 0f02e2a
out/production/java-data-structures/TheStack.class
1.07 KB
src/TheStack.java
@@ -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
15
16
+ System.out.println(chips.empty());
17
+ System.out.println(chips.search("funk"));
18
+ }
19
+}
0 commit comments