February 2014
Beginner
1248 pages
62h 25m
English
• Java treats floating-point constants like 1000.0 and 0.05 as type double. Similarly, Java treats whole-number constants like 7 and -22 as type int.
• 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.
• Math.pow(x, y) (p. 162) calculates the value of x raised ...
Read now
Unlock full access