Collections_Generics_ExceptionHandling

Quiz
•
Science
•
University
•
Hard
pear pear
Used 5+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Why are ArrayLists better than arrays ?
You don't have to decide the size of an ArrayList when you first make it.
You can put more items into an ArrayList than into an array.
ArrayLists can hold more kinds of objects than arrays.
You don't have to decide the type of an ArrayList when you first make it.
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
You get a NullPointerException. What is the most likely cause?
A file that needs to be opened cannot be found.
A network connection has been lost in the middle of communications.
Your code has used up all available memory.
The object you are using has not been instantiated.
3.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
What is the output of this code?
[abc, 0, 2, 10]
The code does not compile.
[abc, 2, 10, 0]
[0, 10, 2, abc]
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which code snippet is valid ?
ArrayList<String> words = new ArrayList<String>(){"Hello", "World"};
ArrayList words = Arrays.asList("Hello", "World");
ArrayList<String> words = new ArrayList<>(Arrays.asList("Hello", "World"));
ArrayList<String> words = {"Hello", "World"};
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which characteristic does not apply to instances of java.util.HashSet?
uses hashcode of objects when inserted
contains unordred elements
contains unique elements
contains sorted elements
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You have an instance of type Map<String, Integer> named instruments containing the following key-value pairs: guitar=1200, cello=3000, and drum=2000. If you add the new key-value pair cello=4500 to the Map using the put method, how many elements do you have in the Map when you call instruments.size()?
2
3
4
When calling the put method, Java will throw an exception
7.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
What is the result of this code?
Hello World
It will not compile because the second catch statement is unreachable
Hello World!
It will throw a runtime exception
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Science STAAR Review Category 1

Quiz
•
8th Grade - University
15 questions
Quis 1 Analisis Data

Quiz
•
University
18 questions
Ekatvam 2023 - Quiz - Round 2 (Sustainable Development)

Quiz
•
University
16 questions
Intermediate Robotics Programming

Quiz
•
University - Professi...
19 questions
pre-assessement quiz link for Python+ML Dharwad Naresh

Quiz
•
University
13 questions
Vibraciones y rotaciones (TCM-2)

Quiz
•
University
15 questions
Le Chatelier Principle

Quiz
•
11th Grade - University
14 questions
CABG SURGEY

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Science
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University