Monday, December 16, 2019

How is Exception Handling implemented in C#?

Exception handling is done using four keywords in C#:
  • try – Contains a block of code for which an exception will be checked.
  • catch – It is a program that catches an exception with the help of exception handler.
  • finally – It is a block of code written to execute regardless whether an exception is caught or not.
  • Throw – Throws an exception when a problem occurs.

1 comment: