Oracle Java SE 21 Developer Professional 1z0-830 Question # 9 Topic 1 Discussion

Oracle Java SE 21 Developer Professional 1z0-830 Question # 9 Topic 1 Discussion

1z0-830 Exam Topic 1 Question 9 Discussion:
Question #: 9
Topic #: 1

Given:

java

Deque deque = new ArrayDeque<>();

deque.offer(1);

deque.offer(2);

var i1 = deque.peek();

var i2 = deque.poll();

var i3 = deque.peek();

System.out.println(i1 + " " + i2 + " " + i3);

What is the output of the given code fragment?


A.

1 2 1


B.

An exception is thrown.


C.

2 2 1


D.

2 1 2


E.

1 2 2


F.

1 1 2


G.

2 1 1


Get Premium 1z0-830 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.