Advertisement
Aldin-SXR

Stack main()

Mar 5th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. public static void main(String[] args) {
  2.     Stack<Integer> stack = new Stack<Integer>();
  3.        
  4.     stack.push(2);
  5.     stack.push(8);
  6.     stack.push(5);
  7.        
  8.     System.out.println(stack.pop());
  9.     System.out.println(stack.pop());
  10.     System.out.println(stack.pop());
  11.        
  12.     stack.push(10);
  13.     System.out.println("stack size: " + stack.size());
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement