}
catch (ExceptB exc) {
Console.WriteLine(exc);
}
catch (ExceptA exc) {
Console.WriteLine(exc);
}
catch (Exception exc) {
Console.WriteLine(exc);
}
}
}
}
.
ExceptA.
ExceptB.
System.Exception: "System.Exception".
OrderMatters.Main() <_ >: 3 6
catch. . ExceptB ExceptA, ExceptB ExceptA. , Exception (.. ) . , catch. .
catch, , . , . , , , .
checked unchecked
C# , , . , , . . .
byte a, b, result; = 127;
= 127;
result = (byte)( * b);
b byte. , ,
Result.
C# , , checked unchecked. , , , checked, unchecked. , .
checked . , . , . :
checked ()
checked {
//
|
|
}
. , OverflowException.
unchecked . , . , :
unchecked () unchecked {
// ,
}
, . , .