已检查和未检查之间有什么区别? [英] What is the difference between checked and unchecked?

查看:209
本文介绍了已检查和未检查之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者之间有什么区别

checked(a + b)

unchecked(a + b)

?

推荐答案

这些运算符会检查(或不检查)结果数值运算中的溢出.在checked情况下,如果运算结果超出数据类型允许的最小值或最大值,则会引发OverflowException异常.

Those are operators that check (or do not check) for overflow in the resulting numerical operation. In the checked case, an OverflowException exception is raised if the result of the operation exceeds the minimum or maximum value allowed for the datatype.

更多信息可从 MSDN 中获得.

这篇关于已检查和未检查之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆