printf4test.java
来自「经典教材:java核心技术卷1、卷2的所有源代码」· Java 代码 · 共 21 行
JAVA
21 行
/**
@version 1.10 1997-07-01
@author Cay Horstmann
*/
import java.io.*;
class Printf4Test
{
public static void main(String[] args)
{
double price = 44.95;
double tax = 7.75;
double amountDue = price * (1 + tax / 100);
PrintWriter out = new PrintWriter(System.out);
/* This call will throw an exception--note the %% */
Printf4.fprint(out, "Amount due = %%8.2f\n", amountDue);
out.flush();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?