這段時間對這個方法用的多,但是瞭解的很少.有必要拉出來翻譯翻譯.
好,先上原文和翻譯:
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版本