Multiple Choice
Select an appropriate declaration to complete the following code segment, which is designed to read strings from standard input and display them in increasing alphabetical order, excluding any duplicates. _________________________________________
Scanner input = new Scanner(System.in) ;
While (input.hasNext() )
{
Words.add(input.next() ) ;
}
System.out.print(words) ;
A) LinkedList<String> words = new LinkedList<String>() ;
B) Set<String> words = new Set<String>() ;
C) Set<String> words = new HashSet<String>() ;
D) Set<String> words = new TreeSet<String>() ;
Correct Answer:

Verified
Correct Answer:
Verified
Q8: Select an appropriate expression to complete the
Q9: Assume that you have declared a map
Q10: Which of the following statements about hash
Q11: Complete the following code, which is intended
Q12: When using a list iterator, on which
Q14: What is the meaning of the type
Q15: You intend to use a hash set
Q16: Consider the code snippet shown below: Stack<String>
Q17: Assume you have created a linked list
Q18: What operation is least efficient in a