You are developing code for a class named Account. The Account class includes the
following method:
You need to ensure that overflow exceptions are thrown when there is an error.
Which type of block should you use?
A.
checked
B.
try
C.
using
D.
unchecked
A
A
try
{
int ten = 1;
checked
{
int i3 = 2147483647 + ten;
Console.WriteLine(i3);
}
}
catch (OverflowException ex)
{ Console.WriteLine(ex.Message); }