Multiple Choice
Assuming that names is a Queue of String objects, select a statement to complete the code segment below.The code is designed to remove the last element from the queue, which is guaranteed to have at least one element.
A) aQueue.add(names.peek() ) ;
B) aQueue.add(names.remove() ) ;
C) names.add(aQueue.peek() ) ;
D) names.add(aQueue.remove() ) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q30: A list is a collection that _.<br>A)does
Q31: Which of the following statements about a
Q32: You need to write a program to
Q33: A collection without an intrinsic order is
Q34: Which of the following statements about manipulating
Q36: Assume that you have declared a set
Q37: An Undo feature in a word processor
Q38: Which of the following statements about linked
Q39: A stack is a collection that _.<br>A)does
Q40: You need to access values in objects