
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
15 questions
Hacker
Quiz
•
University
12 questions
Quiz PAW 03
Quiz
•
University
15 questions
java básico y pilas
Quiz
•
University
20 questions
Network ports
Quiz
•
1st Grade - University
15 questions
Coding club Summit Online Quiz
Quiz
•
University
10 questions
JSPS Competition Hackathon - Scratch Language - Grade 1
Quiz
•
2nd Grade - University
20 questions
TEST FINAL - Algoritmia de Programación
Quiz
•
University
14 questions
ICDL Cyber Security
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
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
