Exam 15: The Java Collections Framework
Exam 1: Introduction96 Questions
Exam 2: Fundamental Data Types103 Questions
Exam 3: Decisionseasy99 Questions
Exam 4: Loops100 Questions
Exam 5: Methods94 Questions
Exam 6: Arrays and Arraylists100 Questions
Exam 7: Inputoutput and Exception Handling100 Questions
Exam 8: Objects and Classes101 Questions
Exam 9: Inheritance and Interfaces99 Questions
Exam 10: Graphical User Interfaces54 Questions
Exam 11: Advanced User Interfaces91 Questions
Exam 12: Object-Oriented Design100 Questions
Exam 13: Recursion100 Questions
Exam 14: Sorting and Searching99 Questions
Exam 15: The Java Collections Framework100 Questions
Exam 16: Basic Data Structures94 Questions
Exam 17: Tree Structures100 Questions
Exam 18: Generic Classes78 Questions
Exam 19: Streams and Binary Inputoutput82 Questions
Exam 20: Multithreading82 Questions
Exam 21: Internet Networking74 Questions
Exam 22: Relational Databases75 Questions
Exam 23: XML74 Questions
Exam 24: Web Applications74 Questions
Select questions type
When using a list iterator, on which condition will the NoSuchElementException be thrown?
(Multiple Choice)
4.9/5
(42)
Assume that you have declared a map named myMap to hold String elements with Integer keys. Which of the following statements will correctly remove an element from myMap?
(Multiple Choice)
4.9/5
(35)
You have decided to store objects of a class in a TreeSet structure. Which of the following statements is correct?
(Multiple Choice)
4.8/5
(31)
You need to access values in objects by a key that is not part of the object. Which collection type should you use?
(Multiple Choice)
4.9/5
(38)
Which of the following statements about manipulating objects in a map is NOT correct?
(Multiple Choice)
4.7/5
(36)
Which of the following statements about linked lists is correct?
(Multiple Choice)
4.8/5
(42)
Which method is NOT part of the ListIterator generic class?
(Multiple Choice)
4.9/5
(38)
Suppose you push integer elements 1,2,3,4 onto a stack in that order. Then pop an element off the stack and add that element to a queue. You repeat that process three more times. In what order will you remove the elements from the queue?
(Multiple Choice)
4.9/5
(43)
Consider the following code snippet:
LinkedList<String> words = new LinkedList<String>();
Words.addLast("abc");
Words.addLast("def");
Words.addLast("ghi");
System.out.print(words.removeLast());
System.out.print(words.removeFirst());
System.out.print(words.removeLast());
What will this code print when it is executed?
(Multiple Choice)
4.8/5
(36)
Consider the following code snippet:
LinkedList<String> words = new LinkedList<String>();
Words.addFirst("abc");
Words.addLast("def");
Words.addFirst("ghi");
System.out.print(words.removeLast());
System.out.print(words.removeFirst());
System.out.print(words.removeLast());
What will this code print when it is executed?
(Multiple Choice)
4.8/5
(36)
What type of access does a LinkedList provide for its elements?
(Multiple Choice)
4.9/5
(36)
Which of the following statements about data structures is correct?
(Multiple Choice)
4.7/5
(34)
Which of the following algorithms would be efficiently executed on an ArrayList?
(Multiple Choice)
4.8/5
(40)
A collection that remembers the order of items, and allows items to be added and removed only at one end is called a ____.
(Multiple Choice)
4.8/5
(42)
Assume you are using a doubly-linked list data structure with many nodes. What is the minimum number of node references that are required to be modified to remove a node from the middle of the list? Consider the neighboring nodes.
(Multiple Choice)
4.8/5
(33)
Which of the following statements about the TreeSet class is NOT correct?
(Multiple Choice)
4.7/5
(41)
Complete the following code, which is intended to print out all key/value pairs in a map named myMap that contains String data for student IDs and names:
Map<String, String> myMap = new HashMap<String, String>();
) . .
Set<String> mapKeySet = myMap.keySet();
For (String aKey : mapKeySet)
{
___________________________;
System.out.println("ID: " + aKey + "->" + name);
}
(Multiple Choice)
4.7/5
(43)
Complete the following code snippet, which is intended to determine if a specific value in a variable named targetWord appears in a set of String values named mySet:
For (String aWord : mySet)
{
_______________________
{
System.out.println ("The word " + targetWord + " was found.");
}
)
(Multiple Choice)
4.8/5
(32)
Showing 41 - 60 of 100
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)