Câu hỏi phỏng vấn C#
Câu hỏi

What is the difference between System.Application...

Câu trả lời

The main differences between System.ApplicationException and System.SystemException in C# are:

  1. Derivation: System.SystemException is a base class for all exceptions generated by the .NET runtime, while System.ApplicationException is a base class for exceptions generated by application code[1][2][3].

  2. Occurrence: System.SystemException is thrown when a non-recoverable, fatal error occurs, such as a database crash or index out-of-bounds error. System.ApplicationException is thrown when a recoverable error occurs, such as invalid input data or an arithmetic exception[2][3][4].

  3. Handling: System.SystemException is not meant to be handled by application code, as the errors are unrecoverable. System.ApplicationException is designed to be handled using try-catch blocks in application code[1][2][3].

  4. Customization: Developers can create custom exception classes derived from System.ApplicationException to represent application-specific errors. System.SystemException is ...

senior

senior

Gợi ý câu hỏi phỏng vấn

middle

What is the use of Null Coalescing Operator ( ?? ) in C#?

senior

Why to use lock statement in C#?

middle

What is Extension Method in C# and how to use them?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào