Multiple Choice
Select an appropriate expression to complete the method below. The method should return the number of times that the string stored in name appears in theList. public static int count(LinkedList<String> theList, String name)
{
Int number = 0;
Iterator<String> iter = theList.iterator() ;
While (______________________)
{
If (iter.next() .equals(name) )
{
Number++;
}
}
Return number;
}
A) iter.hasNext()
B) iter.next() != null
C) theList.hasNext()
D) theList.next() != null
Correct Answer:

Verified
Correct Answer:
Verified
Q19: Which of the following statements about the
Q20: Which data structure would best be used
Q21: A collection without an intrinsic order is
Q22: Select an appropriate expression to complete the
Q23: Which of the following statements about a
Q25: Consider the following code snippet: Stack<String> stringStack
Q26: Consider the following code snippet: LinkedList<String> words
Q27: Which of the following statements about manipulating
Q28: Which operations from the list data structure
Q39: Which Java package contains the LinkedList class?<br>A)java.lang<br>B)java.util<br>C)java.collections<br>D)java.io