Deque output

Report a typo

What does this code print?

Deque<String> states = new ArrayDeque<String>();

states.add("Germany");
states.add("France");
states.push("UK");
states.offerLast("Norway");

String sPop = states.pop();
String sPeek = states.peek();
String sPeekLast = states.peekLast();
states.offer(sPop);
String sPollLast = states.pollLast();

while (states.peek() != null) {   
    System.out.print(states.pop());
}
Select one option from the list
___

Create a free account to access the full topic