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
Consider the code snippet shown below. Assume that employeeNames is an instance of type LinkedList<String>.
For (String name : employeeNames)
{
// Do something with name here
}
Which element(s) of employeeNames does this loop process?
Free
(Multiple Choice)
4.8/5
(39)
Correct Answer:
B
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>();
) . .
_______________________________
For (String aKey : mapKeySet)
{
String name = myMap.get(aKey);
System.out.println("ID: " + aKey + "->" + name);
}
Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
D
You need to write a program to simulate the effect of adding an additional cashier in a supermarket to reduce the length of time customers must wait to check out. Which data structure would be most appropriate to simulate the waiting customers?
Free
(Multiple Choice)
5.0/5
(30)
Correct Answer:
C
You want to enumerate all of the keys in a map named myMap whose keys are type String. Which of the following statements will allow you to do this?
(Multiple Choice)
4.9/5
(44)
When using a list iterator, on which condition will the IllegalStateException be thrown?
(Multiple Choice)
4.7/5
(29)
Assume you have created a linked list named myList that currently holds some number of String objects. Which of the following statements correctly adds a new element to the beginning of myList?
(Multiple Choice)
4.7/5
(41)
What is included in a linked list node?
I a reference to its neighboring nodes
II an array reference
III a data element
(Multiple Choice)
4.9/5
(42)
A linked list ____ encapsulates a position anywhere inside the linked list.
(Multiple Choice)
4.9/5
(32)
A(n) ____ is a data structure used for collecting a sequence of objects that allows efficient addition and removal of already-located elements in the middle of the sequence.
(Multiple Choice)
4.9/5
(47)
Print jobs submitted to a printer would probably be stored in which type of data structure?
(Multiple Choice)
4.8/5
(41)
Assume that you have declared a set named mySet to hold String elements. Which of the following statements will correctly insert an element into mySet?
(Multiple Choice)
4.8/5
(46)
Which data structure would best be used for keeping track of a growing set of groceries to be purchased at the food market?
(Multiple Choice)
4.9/5
(35)
Assume that you have declared a stack named myStack to hold String elements. Which of the following statements will correctly remove an element from myStack?
(Multiple Choice)
4.9/5
(43)
Assume that you have declared a stack named myStack to hold String elements. Which of the following statements will correctly retrieve the top element from myStack without removing it?
(Multiple Choice)
4.9/5
(37)
Which data structure would best be used for storing a set of numbers and sorting them in ascending order?
(Multiple Choice)
4.8/5
(39)
We might choose to use a linked list over an array list when we will not require frequent ____.
I random access
II inserting new elements
III removing of elements
(Multiple Choice)
4.8/5
(49)
The nodes of a(n) ____ linked list class store two links: one to the next element and one to the previous one.
(Multiple Choice)
4.7/5
(34)
Which data structure would best be used for keeping track of bank customers waiting for a teller?
(Multiple Choice)
4.9/5
(37)
Showing 1 - 20 of 100
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)