Catch System.NullReferenceException
using System;
class MainClass
{
static void Main()
{
try {
string str = null;
str.ToUpper();
}catch (System.NullReferenceException) {
Console.WriteLine("catch clause");
} finally {
Console.WriteLine("finally clause");
}
}
}
Output catch clause
finally clause
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
|