Section 5.4 Examples Using the for Statement
• Java treats floating-point constants like
0.05 as type
double. Similarly, Java treats whole-number constants like
-22 as type
• The format specifier
%4s outputs a
String in a field width (p. 161) of 4—that is,
printf displays the value with at least 4 character positions. If the value to be output is less than 4 character positions wide, the value is right justified (p. 161) in the field by default. If the value is greater than 4 character positions wide, the field width expands to accommodate the appropriate number of characters. To left justify (p. 161) the value, use a negative integer to specify the field width.
) (p. 162) calculates the value of x raised ...