Solved

Assuming That Names Is a Queue of String Objects, Select

Question 35

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. 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() ) ;


A) aQueue.add(names.peek() ) ;
B) aQueue.add(names.remove() ) ;
C) names.add(aQueue.peek() ) ;
D) names.add(aQueue.remove() ) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions