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 following code snippet:
Stack<String> words1 = new Stack<String>();
ArrayList<String> words3 = new ArrayList<String>();
Words1.push("abc");
Words1.push("def");
Words1.push("ghi");
While (!words1.empty())
{
Words3.add(words1.pop());
}
Int i = words3.size() - 1;
While (i >= 0)
{
System.out.print(words3.remove(i));
I--;
}
What will this code print when it is executed?
(Multiple Choice)
4.8/5
(39)
Assume that you have declared a map named myMap to hold String elements with Integer keys. Which of the following statements will correctly insert an element into myMap?
(Multiple Choice)
4.8/5
(33)
Which of the following correctly declares a stack that will hold String elements?
(Multiple Choice)
4.9/5
(42)
You need to access values by their position. Which collection type should you use?
(Multiple Choice)
4.7/5
(33)
When using a list iterator, on which condition will the IllegalStateException be thrown?
(Multiple Choice)
4.7/5
(37)
You need to access values by an integer position. Which collection type should you use?
(Multiple Choice)
4.8/5
(46)
You need to write a program to build and maintain an address book. Since the program must support the possibility of having duplicate names, which data structure would be most appropriate to model this situation?
(Multiple Choice)
5.0/5
(45)
Which of the following algorithms would be efficiently executed using a LinkedList?
(Multiple Choice)
4.8/5
(45)
To create a TreeSet for a class of objects, the object class must ____.
(Multiple Choice)
5.0/5
(34)
Suppose we create a deque (double-ended queue) data structure. It is basically a queue, with its addLast and removeFirst operations, but we also add the addFirst and removeLast operations. Which of the following is best modeled by the deque data structure?
(Multiple Choice)
4.8/5
(39)
Which of the following statements about the LinkedList class is correct?
(Multiple Choice)
4.9/5
(42)
Consider the following code snippet:
Queue<String> stringQueue = new LinkedList<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.8/5
(34)
Consider the following code snippet:
Map<String, Integer> scores;
If you need to visit the keys in sorted order, which of the following statements will create a structure to support this?
(Multiple Choice)
4.7/5
(33)
Assume that you have declared a map named myMap to hold String elements with Integer keys. Which of the following statements will correctly retrieve the value of an element from myMap by using its key?
(Multiple Choice)
4.8/5
(35)
Which of the following statements about manipulating objects in a set is correct?
(Multiple Choice)
4.9/5
(28)
Suppose we create a deque (double-ended queue) data structure. It is basically a queue, with its addLast and removeFirst operations, but we also add the addFirst and removeLast operations. If a line at the grocery store resembles a deque more than a queue, what is the most likely reason?
I the cashier is very fast
II the line is very long
III the cashier is very slow
(Multiple Choice)
4.7/5
(35)
Which data structure would best be used for finding a path out of a maze?
(Multiple Choice)
4.7/5
(40)
Showing 81 - 100 of 100
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)