Which type of block should you use?

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?

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



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Alisher

Alisher

try
{
int ten = 1;
checked
{
int i3 = 2147483647 + ten;
Console.WriteLine(i3);
}
}
catch (OverflowException ex)

{ Console.WriteLine(ex.Message); }