C# Exceptions Flashcards

1
Q

Which of the following is NOT a .NET Exception class?
1. Exception
1. StackMemoryException
1. DivideByZeroException
1. OutOfMemoryException
1. InvalidOperationException

A

StackMemoryException

These are the valid exceptions https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/using-standard-exception-types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following statements is correct about an Exception?
1. It occurs during compilation.
2. It occurs during linking.
3. It occurs at run-time.
4. It occurs during Just-In-Time compilation.
5. It occurs during loading of the program.

A

It occurs at run-time

The exceptions only occur during runtime because in C# exceptions are treated as unchecked exceptions (checked during runtime. Not compile time).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly