Skip to content
Home
About us
Quizzes
Practice Tests
o
o
o
o
o
o
IS5103 Lesson-9 Quiz
Mark
August 12, 2024
IS5103
1.Suppose you need to display a collection of products for sale, which
may contain duplicates. Additionally, you have a collection of sales that
This study source was downloaded by 100000903174213 from CourseHero.com on 01-12-2026 11:45:03 GMT -06:00
https://www.coursehero.com/file/250925557/Quiz-9docx/
, you need to track, sorted by the natural order of the sale ID, and you
need to retrieve the text of each. Which of the following from the java.util
package best suit your needs for this scenario?
Each correct answer represents a complete solution. Choose all that apply.
A) ArrayList, TreeMap
2.What is the result of the following statements?
1. var greetings = new ArrayDeque();
2.greetings.offerLast(“hello”);
3.greetings.offerLast(“hi”);
4.greetings.offerFirst(“ola”);
5.greetings.pop();
6.greetings.peek();
7.while (greetings.peek() != null)
8.System.out.print(greetings.pop());
A) Hellohi
3.Which options are true of the following code?
1.__ q = new LinkedList<>();
2.q.add(10);
3.q.add(12);
4.q.remove(1);
5.System.out.print(q);
Each correct answer represents a complete solution. Choose all that apply.
A) If we fill in the blank with List, the output is [10]. ,
If we fill in the blank with var, the output is [10].
4.Which of the following will compile when filling in the blank?
1. var list = List.of(1, 2, 3);
2. var set = Set.of(1, 2, 3);
3. var map = Map.of(1, 2, 3, 4);
4. _.forEach(System.out::println);
Each correct answer represents a complete solution. Choose all that
apply.
A) List
Set
map.keySet()
map.values()
5.What is the result of the following code?
1.Map m = new HashMap();
2.m.put(123, “456”);
This study source was downloaded by 100000903174213 from CourseHero.com on 01-12-2026 11:45:03 GMT -06:00
https://www.coursehero.com/file/250925557/Quiz-9docx/
Home
About us
Quizzes
Practice Tests
o
o
o
o
o
o
IS5103 Lesson-9 Quiz
Mark
August 12, 2024
IS5103
1.Suppose you need to display a collection of products for sale, which
may contain duplicates. Additionally, you have a collection of sales that
This study source was downloaded by 100000903174213 from CourseHero.com on 01-12-2026 11:45:03 GMT -06:00
https://www.coursehero.com/file/250925557/Quiz-9docx/
, you need to track, sorted by the natural order of the sale ID, and you
need to retrieve the text of each. Which of the following from the java.util
package best suit your needs for this scenario?
Each correct answer represents a complete solution. Choose all that apply.
A) ArrayList, TreeMap
2.What is the result of the following statements?
1. var greetings = new ArrayDeque();
2.greetings.offerLast(“hello”);
3.greetings.offerLast(“hi”);
4.greetings.offerFirst(“ola”);
5.greetings.pop();
6.greetings.peek();
7.while (greetings.peek() != null)
8.System.out.print(greetings.pop());
A) Hellohi
3.Which options are true of the following code?
1.__ q = new LinkedList<>();
2.q.add(10);
3.q.add(12);
4.q.remove(1);
5.System.out.print(q);
Each correct answer represents a complete solution. Choose all that apply.
A) If we fill in the blank with List, the output is [10]. ,
If we fill in the blank with var, the output is [10].
4.Which of the following will compile when filling in the blank?
1. var list = List.of(1, 2, 3);
2. var set = Set.of(1, 2, 3);
3. var map = Map.of(1, 2, 3, 4);
4. _.forEach(System.out::println);
Each correct answer represents a complete solution. Choose all that
apply.
A) List
Set
map.keySet()
map.values()
5.What is the result of the following code?
1.Map m = new HashMap();
2.m.put(123, “456”);
This study source was downloaded by 100000903174213 from CourseHero.com on 01-12-2026 11:45:03 GMT -06:00
https://www.coursehero.com/file/250925557/Quiz-9docx/