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

Explanation:
http://sholfen.pixnet.net/blog/post/47467244-c#—checked-關鍵字
Aline提供



Leave a Reply 1

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


bjotta

bjotta

A – You need to fill this in a checked block because it makes sure the code does not overflow. If there is no checkedblock it can overflow, depending on the compiler options.