simpleformat.java
来自「这是Java思想的最高集萃」· Java 代码 · 共 15 行
JAVA
15 行
package chapter13;
public class SimpleFormat {
public static void main(String args[]){
int x=2008;
System.out.println("Row 1: "+x+"");
System.out.println("Row 1.1:"+x);
System.out.format("Row 2: %d\n",x);
System.out.printf("Row 3: %d\n",x);
/*
* 类似C语言中的格式化输出
* 而且,format()与printf()类似
*/
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?