Collections_Generics_ExceptionHandling
Quiz
•
Science
•
University
•
Practice Problem
•
Hard
pear pear
Used 6+ times
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
FSA Science
Quiz
•
8th Grade - University
15 questions
Introduction to Arduino ( Part -II )
Quiz
•
University
15 questions
ESTADÍSTICA DESCRIPTIVA E INFERENCIAL BÁSICA
Quiz
•
University
15 questions
Food Labels
Quiz
•
6th Grade - University
20 questions
COVID 19
Quiz
•
University
15 questions
HTML Quiz
Quiz
•
11th Grade - University
20 questions
Last Exam Basis Data
Quiz
•
University
14 questions
H5.1 Verbranding
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Science
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
