3 public class ExceptionWithAnonMethod
5 public delegate void EmptyCallback();
8 public static int Main()
11 throw new Exception("e is afraid to enter anonymous land");
12 } catch(Exception e) {
13 AnonHandler(delegate {
14 Console.WriteLine(e.Message);
18 if (res == "e is afraid to enter anonymous land"){
19 Console.WriteLine ("Test passed");
22 Console.WriteLine ("Test failed");
26 public static void AnonHandler(EmptyCallback handler)