Java Reference
In-Depth Information
denotes successful completion; you can use nonzero status codes to denote various
error conditions.
An Input Dialog Box
169
170
CHAPTER SUMMARY
1. Java has eight primitive types, including four integer types and two floating
point types.
2. A numeric computation overflows if the result falls outside the range for the
number type.
3. Rounding errors occur when an exact conversion between numbers is not
possible.
4. You use a cast ( typeName ) to convert a value to a different type.
5. Use the Math.round method to round a floating-point number to the nearest
integer.
6. A final variable is a constant. Once its value has been set, it cannot be
changed.
7. Use named constants to make your programs easier to read and maintain.
8. Assignment to a variable is not the same as mathematical equality.
9. The ++ and -- operators increment and decrement a variable.
10. If both arguments of the / operator are integers, the result is an integer and the
remainder is discarded.
11. The % operator computes the remainder of a division.
Search WWH ::




Custom Search