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 5

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


Pete

Pete

C# statements can execute in either checked or unchecked context. In a checked context, arithmetic overflow raises an exception. In an unchecked context, arithmetic overflow is ignored and the result is truncated.

Najlepszy Programista Swiata DAGO

Najlepszy Programista Swiata DAGO

A

Twórca C#

Twórca C#

A jak Anal

Kaabi

Kaabi

OverflowException
Thrown when an arithmetic operation overflows in a checked context.

Lord Vader

Lord Vader

best explanation:
Pete says:
December 8, 2016 at 5:58 pm
C# statements can execute in either checked or unchecked context. In a checked context, arithmetic overflow raises an exception. In an unchecked context, arithmetic overflow is ignored and the result is truncated.