
Java Exception Handling Quiz
Authored by Von Magbitang
Computers
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What happens if an exception is not caught in Java?
Program terminates normally
The program compiles but does not run
The program crashes with an error message
The exception is ignored
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following exception types must be handled explicitly?
NullPointerException
ArrayIndexOutOfBoundsException
ClassCastException
IOException
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
True or False: A finally block will execute even if an exception occurs in the try block.
True
False
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
try {
int x = 5 / 0;
} catch (ArithmeticException e) {
System.out.println("Error");
}
Error
Compilation fails
No output
RuntimeException
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which statement is incorrect about exception handling?
catch block can have multiple exceptions
finally always runs
A try block must be followed by catch
Multiple catch blocks can be used
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
True or False: catch blocks are executed in order from specific to general exceptions.
True
False
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given the following code, what will be printed?
try {
return 1;
} finally {
return 2;
}
1
2
Compilation error
Runtime error
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
Web Dev Midterm Quiz
Quiz
•
University
15 questions
cmd and terminal
Quiz
•
7th Grade - University
17 questions
Minggu V - PKS 2 - Pemrograman C++
Quiz
•
University
16 questions
Algo Quiz
Quiz
•
University
20 questions
Data & Signal
Quiz
•
University
18 questions
Quiz on Misinformation and Bias
Quiz
•
10th Grade - University
15 questions
Microcontroller
Quiz
•
University
20 questions
COA_QUIZ_UNIT I
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade