
Exception handling
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
roop lal
Used 2+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to handle exceptions in C#?
catch
final
throw
error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the finally block do in exception handling?
Executes only when an exception is thrown
Executes only if no exception is thrown
Executes always, regardless of whether an exception occurs or not
Skips execution if an exception is caught
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct order of a try-catch-finally block?
try-catch-finally
try-finally-catch
catch-try-finally
finally-catch-try
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the throw keyword do in C#?
Ignores the exception
Logs the exception
Rethrows the exception
Stops the program
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which class is the base class for all exceptions in C#?
Error
Exception
BaseException
SystemException
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code?
try {
int x = 5 / 0;
} catch (DivideByZeroException) {
Console.WriteLine("Divide by zero");
} finally {
Console.WriteLine("Finally block");
}
Runtime error
Divide by zero
Divide by zero
Finally block
Finally block only
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will happen if an exception is thrown and not caught?
Program will continue execution
Program will crash
Exception will be logged
Exception will be ignored
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
20 questions
DIS final quiz
Quiz
•
University
20 questions
ROUND 1
Quiz
•
University
15 questions
Chapter 8 - Memory Management Strategies
Quiz
•
University
20 questions
IT Essential UIUX Chapter 03 (Typography)
Quiz
•
University
11 questions
Final Keamanan Komputer / Sistem Keamanan Jaringan
Quiz
•
University
20 questions
Video
Quiz
•
University
11 questions
Types of Mass Media
Quiz
•
10th Grade - Professi...
10 questions
T3. C1-C2 Quizizz Post-Test
Quiz
•
7th Grade - 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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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
