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
A collection that allows items to be added only at one end and removed only at the other end is called a ____.
(Multiple Choice)
4.9/5
(34)
Assume that you have declared a queue named myQueue to hold String elements. Which of the following statements will correctly remove an element from myQueue?
(Multiple Choice)
4.7/5
(35)
You need to access values using a key, and the keys must be sorted. Which collection type should you use?
(Multiple Choice)
4.9/5
(35)
Consider the code snippet shown below:
Stack<String> words1 = new Stack<String>();
Stack<String> words2 = new Stack<String>();
Words1.push("abc");
Words1.push("def");
Words1.push("ghi");
While (!words1.empty())
{
Words2.push(words1.pop());
}
While (!words2.empty())
{
System.out.print(words2.pop());
}
What will be printed when this code is executed?
(Multiple Choice)
4.8/5
(46)
Assume that you have declared a queue named myQueue to hold String elements. Which of the following statements will correctly insert an element into myQueue?
(Multiple Choice)
4.8/5
(34)
Assume you have created a linked list name myList that currently holds some number of String objects. Which of the following statements correctly removes an element from the end of myList?
(Multiple Choice)
4.7/5
(37)
A collection that allows speedy insertion and removal of already-located elements in the middle of it is called a ____.
(Multiple Choice)
4.9/5
(36)
Consider the following code snippet:
LinkedList<String> myLList = new LinkedList<String>();
MyLList.add("Mary");
MyLList.add("John");
MyLList.add("Sue");
ListIterator<String> iterator = myLList.listIterator();
Iterator.next();
Iterator.next();
Iterator.add("Robert");
Iterator.previous();
Iterator.previous();
Iterator.remove();
System.out.println(myLList);
What will be printed when this code is executed?
(Multiple Choice)
4.9/5
(37)
Which of the following statements about manipulating objects in a map is NOT correct?
(Multiple Choice)
4.7/5
(50)
Which of the following statements about hash functions is NOT correct?
(Multiple Choice)
4.8/5
(35)
You need to access values in the opposite order in which they were added (last in, first out), and not randomly. Which collection type should you use?
(Multiple Choice)
4.8/5
(33)
Consider the following code snippet:
Stack<String> stringStack = new Stack<String>();
StringStack.push("ab");
StringStack.push("abc");
StringStack.push("a");
While (stringStack.size() > 0)
{
System.out.print(stringStack.pop() + ",");
}
What output will be produced when this code is executed?
(Multiple Choice)
4.9/5
(41)
Which nodes need to be updated when we insert a new node to become the fourth node from the beginning of a doubly-linked list?
(Multiple Choice)
4.7/5
(29)
You need to write a program to build and maintain a catalog of college courses that are associated with specific majors. Which data structure would be most appropriate to model this situation?
(Multiple Choice)
4.8/5
(43)
Which of the following statements about a priority queue structure is correct?
(Multiple Choice)
4.7/5
(43)
Consider the following code snippet:
PriorityQueue<String> stringQueue = new PriorityQueue<String>();
StringQueue.add("ab");
StringQueue.add("abc");
StringQueue.add("a");
While (stringQueue.size() > 0)
{
System.out.print(stringQueue.remove() + ",");
}
What output will be produced when this code is executed?
(Multiple Choice)
4.9/5
(42)
Showing 21 - 40 of 100
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)