- public void println(int x) {
- synchronized (this) {
- print(x);
- newLine();
- }
- }
- /**
- * 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)
复制代码 其实,输出的是 转化成十进制的字符串。 |