Save
SEMESTER 01
PLATFORM DEV THEORY
Chapter 17: Exceptions
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Soeroe
Visit profile
Cards (13)
What does exceptional situations in programming refer to?
Situations like
file unavailability
or
division by zero
View source
How does C# handle exceptions?
C# provides a complete exception
infrastructure
View source
Why do game developers prefer programs to crash instead of using exception handlers?
Exception handling is slow and can affect
performance
View source
What happens when an int division by zero occurs in C#?
An
exception
is thrown, causing a
crash
View source
What is the purpose of a try block in exception handling?
To encapsulate code that might
throw
an exception
View source
What happens if no matching catch clause is found for an exception?
The exception is passed to the
calling method
View source
What is the base class for all exceptions in C#?
System.Exception
View source
What is the role of a finally block in exception handling?
It executes code regardless of exception
occurrence
View source
How does a when clause enhance exception handling?
It allows finer filtering of
caught exceptions
View source
What happens if an exception occurs during a constructor execution?
The exception is passed to the
calling
level
View source
What does Unity do with unhandled exceptions?
Logs them using a
global try/catch
construct
View source
What are the key components of exception handling in C#?
try block
: encapsulates code that may throw exceptions
catch clause
: handles specific exceptions
finally block
: executes code regardless of exceptions
throw statement
: raises exceptions when needed
View source
What are the steps involved in throwing and catching an exception in C#?
Code execution leads to an
exceptional
situation.
An exception is thrown using the throw statement.
The method halts and looks for a
matching
catch clause.
If found, the catch clause executes; if not, it propagates.
Finally
block executes if present.
View source