Can someone explain to me what exactly is the checked an unchecked block ?
And when should I use each ?
Can someone explain to me what exactly is the checked an unchecked block ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Arithmetic overflow; for example:
So use
checkedwhen you don’t want accidental overflow / wrap-around to be a problem, and would rather see an exception.uncheckedexplicitly sets the mode to allow overflow; the default isuncheckedunless you tell the compiler otherwise – either through code (above) or a compiler switch (/checkedin csc).