Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.telerikacademy;
- public class Main {
- public static void main(String[] args) {
- Stack myStack = new StackImpl();
- System.out.println("Empty stack: "+myStack.isEmpty());
- myStack.push(1);
- myStack.push(2);
- myStack.push(3);
- System.out.println(myStack.peek());
- myStack.pop();
- System.out.println(myStack.peek());
- System.out.println(myStack.isEmpty());
- Queue myQueue = new QueueImpl();
- System.out.println("In empty queue the size is: "+myQueue.size());
- myQueue.offer(100);
- myQueue.offer(300);
- myQueue.offer(600);
- System.out.println(myQueue.isEmpty());
- System.out.println(myQueue.peek());
- myQueue.poll();
- myQueue.poll();
- System.out.println(myQueue.peek());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement