Mega Code Archive

 
Categories / C# Tutorial / Language Basics
 

Exception Handling Fundamentals

C# exception handling is managed via four keywords: try, catch, throw, and finally. try {         // block of code to monitor for errors     }     catch (ExcepType1 exOb) {         // handler for ExcepType1      }     catch (ExcepType2 exOb) {         // handler for ExcepType2      }     .     finally{          } If no exception is thrown by a try block, no catch statements will be executed and program control resumes after the catch statement.