corejava第10版
This commit is contained in:
1 parent
2021c3c227
commit
6165543dd3
1088 files changed
+94411
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* @version 1.10 1997-07-01
|
||||
* @author Cay Horstmann
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user