exam questions

Exam 1z0-809 All Questions

View all questions & answers for the 1z0-809 exam

Exam 1z0-809 topic 1 question 136 discussion

Actual exam question from Oracle's 1z0-809
Question #: 136
Topic #: 1
[All 1z0-809 Questions]

Given the code fragment:

What is the result?

  • A. 4000 : 2000
  • B. 4000 : 1000
  • C. 1000 : 4000
  • D. 1000 : 2000
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
pul26
Highly Voted 3 years, 7 months ago
Answer is A, tested Deque<Integer> nums = new ArrayDeque<>(); nums.add(1000); System.out.println(nums); nums.push(2000); System.out.println(nums); nums.add(3000); System.out.println(nums); nums.push(4000); System.out.println(nums); Integer i1 = nums.remove(); System.out.println(nums); Integer i2 = nums.pop(); System.out.println(nums); System.out.println(i1 + ":" + i2);
upvoted 7 times
...
steefaand
Most Recent 5 months, 4 weeks ago
Selected Answer: A
A is correct. Tested. Firstly 1000 is added (at the back), then 2000 is added to front, then 3000 is added to back and finally 4000 to front, so deque looks like 4000-2000-1000-3000 and remove and pop do the same thing which is take value from from of deque and those values are 4000 and 2000 which are printed.
upvoted 1 times
...
YasinGaber
2 years, 5 months ago
A, tested
upvoted 1 times
...
Svetleto13
3 years, 2 months ago
A,tested
upvoted 3 times
...
Sigamani
3 years, 2 months ago
B is correct
upvoted 1 times
Sigamani
3 years, 2 months ago
Sorry, A is correct
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago