
Day 23 - c10p2
Authored by An Bình
Computers, Professional Development
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
Which of the following pairs fill in the blanks to make this code compile?
throw, throw new , throws
throws, throw, throw new
throws, throw new, throw
throws, throw, throw
throw, throws new, throws
2.
MULTIPLE SELECT QUESTION
2 mins • 5 pts
Which of the following statements about finally blocks are true? (Choose all that apply.)
A finally block is required when there are no catch blocks in a regular try statement.
A finally block is required when the program code doesn’t terminate on its own.
A finally block is never required with a try-with-resources
statement.
A finally block is required in order to make sure all
resources are closed in a try-with-resources statement.
A finally block is executed before the resources declared in a try-with-resources statement are closed.
3.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
How many lines occur compile error in this code snippet ?
1
2
3
It compiles and print XAO
It compiles and print XOA
4.
MULTIPLE SELECT QUESTION
2 mins • 5 pts
Which of the following can be inserted on line 8 to make this code compile? (Choose all that apply.)
System.out.println("it's ok");
throw new Exception();
throw new IllegalArgumentException();
throw new java.io.IOException();
throw new RuntimeException();
5.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
What is printed by the following program?
QSM
QMS
SQM
A stack trace
Compile error
6.
MULTIPLE SELECT QUESTION
1 min • 5 pts
Which of the following do not need to be handled or declared? (Choose all that apply.)
ArrayIndexOutOfBoundsException
IllegalArgumentException
IOException
Error
NumberFormatException
7.
MULTIPLE SELECT QUESTION
2 mins • 5 pts
Which lines can fill in the blank to make the following code compile? (Choose all that apply.)
Error a
ClassCastException b
NullPointerException c
RuntimeException d
NumberFormatException e
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?