* Prints an integer. The string produced by <code>{@link
* java.lang.String#valueOf(int)}</code> is translated into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
*
* @param i The <code>int</code> to be printed
* @see java.lang.Integer#toString(int)
*/
public void print(int i) {
write(String.valueOf(i));
}
/**
* Returns the string representation of the <code>int</code> argument.
* <p>
* The representation is exactly the one returned by the
* <code>Integer.toString</code> method of one argument.
*
* @param i an <code>int</code>.
* @return a string representation of the <code>int</code> argument.
* @see java.lang.Integer#toString(int, int)
*/
public static String valueOf(int i) {
return Integer.toString(i, 10);
}
* @param radix the radix to use in the string representation.
* @return a string representation of the argument in the specified radix.
* @see java.lang.Character#MAX_RADIX
* @see java.lang.Character#MIN_RADIX
*/
public static String toString(int i, int radix)
复制代码
其实,输出的是 转化成十进制的字符串。作者: 王玮 时间: 2012-12-18 11:48
Prints an integer. The string produced by 打印一个整数。由java.lang.String valueOf(int ) 产生的字符串,被转换成平台默认字符编码的二进制数,这些二进制数用write(int) 方法被写出。
* java.lang.String#valueOf(int) is translated into bytes
* according to the platform's default character encoding, and these bytes