formatterexample.java
来自「JAVA SE6 全方位学习 朱仲杰 编著 机械工业出版社出版」· Java 代码 · 共 19 行
JAVA
19 行
package java2.G;
import java.util.*;
import static java.lang.System.*;
public class FormatterExample
{
public static void main(String[] args)
{
double num1 = 12345.678;
out.printf("Before format: %s%n", num1);
out.printf("After format: %,.2f%n", num1);
Date d = new Date();
out.printf("Before format: %s%n", d);
out.printf("After format: %tY/%<tm/%<td %<tT%n",d);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?