C is correct, but it would be printed in new lines. pop and remove both remove from start of queue and print what was removed and after tat queue is printed.
Answer is C:
Deque<String> queue = new ArrayDeque<>();
queue.add("Susan");
queue.add("Allen");
queue.add("David");
System.out.println(queue.pop());
System.out.println(queue.remove());
System.out.println(queue);
upvoted 1 times
...
Log in to ExamTopics
Sign in:
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.
Svetleto13
Highly Voted 3 years, 2 months agosteefaand
Most Recent 6 months agoKim514
1 year, 3 months ago