Its pretty simple again as the name suggests,
Remember you shouldn't use a try catch block if you don't expect any errors in the first place
An example of try catch finally would be this;
Remember you shouldn't use a try catch block if you don't expect any errors in the first place
An example of try catch finally would be this;
try { int a = 10; int b = 20; int z = a + b; } catch (Exception e) { Console.WriteLine(e.Message); } finally { Console.WriteLine("Executed"); }
No comments:
Post a Comment