CSharp examples for Custom Type:try catch finally
Nesting Try Blocks
using System;/*from w ww . j a va 2s. c o m*/ class TryNestTester { public static void Main() { try { try { int[] myArray = new int[10]; myArray[50] = 498; } catch(DivideByZeroException exObj) { Console.WriteLine("Inside inner catch block"); Console.WriteLine("Exception: " + exObj.Message); } } catch(IndexOutOfRangeException exObj) { Console.WriteLine("Inside outer catch block"); Console.WriteLine("Exception: " + exObj.Message); } } }