首页 > 其他 > 详细

弱类型语言的布尔值转换

时间:2014-01-23 05:15:51      阅读:344      评论:0      收藏:0      [点我收藏+]

  In some languages (e.g. C), the boolean values are defined as actual numerical values, so they are just different names for

1 and 0 (or -1 and 0).

  In some other languages (e.g.  Java),treats boolean as a completely separate data type which has 2 distinct values: true and false.

The values 1 and 0 are of type int and are not implicitly convertible to boolean.

  Javascript falls in the category that has a distinct boolean type, but on the other hand Javascript is quite keen to convert values

between different data types.

弱类型语言的布尔值转换

原文:http://www.cnblogs.com/yuyutianxia/p/3530338.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!