Java: Integer.toBinaryString(int i) 方法翻译详解

这段时间对这个方法用的多,但是了解的很少.有必要拉出来翻译翻译.

好,先上原文和翻译:

String java.lang.Integer.toBinaryString( int i)

Return a string representation of the integer argument as an unsigned integer in base 2
返回一个代表 把整型类型的数字看成无符号正数 的字符串

The unsigned integer value is the argument plus 232 if the argument is negative; otherwise it is equal to the argument.This value is converted to a string of ASCLL digits in binary (base 2) with on extra leading 0s. If the unsigned magnitude is zero , it is represented by a single zero character ‘0’(‘\u0030’);otherwise, the first character of the representating of the unsinged magnitude will not be the zero character. The characters ‘0’(‘\u0030’) and ‘1’(‘\u0031’) are used as binary digit .
无符号数字(相当于计算机未进行识别正负的二进制)
如果整型变量为负,这个变量加上二百三十二就是实际储存的二进制;如果整型变量为正,这个变量的二进制就是实际存储的二进制.然后,从左到右扫描入字符串中.如果无符号值为零,它就只用一个零来表示;否则的话,无符号字符串第一位不用零来表示.二进制表中只用0和1.

Parameters:
 参数
..i an integer to be converted to a string
.. i 将要被转化为字符串的整型变量

Returns:
 返回值
..the string representation of the unsigned integer value repersented by the argument in binary(base 2)
..无符号整型的值的字符串表示

Since:
 第一次出现版本
..JDK 1.0.1
 Java开发包1.0.1版本

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值