Files
corejava/corejava第10版/v2ch12/printf2/Printf2Test.java
T
2019-05-22 19:31:49 +08:00

17 lines
334 B
Java

/**
* @version 1.10 1997-07-01
* @author Cay Horstmann
*/
class Printf2Test
{
public static void main(String[] args)
{
double price = 44.95;
double tax = 7.75;
double amountDue = price * (1 + tax / 100);
String s = Printf2.sprint("Amount due = %8.2f", amountDue);
System.out.println(s);
}
}