Advertisement
tankostanev99

Untitled

Sep 18th, 2023
880
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | Software | 0 0
  1. import java.util.ArrayDeque;
  2.  
  3. public class Sample {
  4.     public static void main(String[] args) {
  5.         ArrayDeque<Integer> stackque=new ArrayDeque<>();
  6.         stackque.add(1);
  7.         stackque.push(2);
  8.         stackque.add(3);
  9.         stackque.push(4);
  10.         stackque.add(5);
  11.         System.out.println(stackque);
  12.         System.out.println(stackque.poll());
  13.         System.out.println(stackque.poll());
  14.         System.out.println(stackque.poll());
  15.  
  16.         System.out.println(stackque);
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement