这段时间对这个方法用的多,但是了解的很少.有必要拉出来翻译翻译.
好,先上原文和翻译:
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版本