using System; public class Ex { int p; public static int test1 () { Ex x = null; try { Console.WriteLine(" before"); x.p = 1; Console.WriteLine(" after"); } catch (NullReferenceException) { Console.WriteLine("catched"); return 0; } Console.WriteLine("Not catched"); return 1; } public static int Main () { test1(); return 0; } }