using System;
class Program
{
static void test(string s) {
if (s == null) {
throw new ArgumentNullException();
}
}
static void Main()
{
try {
string s = null;
test(s);
}
catch (ArgumentNullException ex) {
Console.WriteLine("catch (ArgumentNullException ex): {0}", ex);
}
catch (Exception ex) {
Console.WriteLine("catch (Exception ex): {0}", ex);
}
}
}
/*
run:
catch (ArgumentNullException ex): System.ArgumentNullException: Value cannot be null.
at Program.Main () [0x00002] in <d1d2cd0e27104097b286d3b2e5edcf4a>:0
*/