
Exception handling

Quiz
•
Computers
•
University
•
Medium
roop lal
Used 2+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
18 questions
Python Programming Quiz

Quiz
•
University
20 questions
Java Coding Questions

Quiz
•
University
13 questions
CSE_A1_QUIZ 6(15-05-23)

Quiz
•
University
10 questions
Exception Handling and CollectionQuiz

Quiz
•
University
10 questions
Python Runtime Errors and Exception Handling Quiz

Quiz
•
University
17 questions
Python PBO

Quiz
•
University
14 questions
.NET Advanced

Quiz
•
University - Professi...
15 questions
Python Exception

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University