Page 105 - AP Computer Science A, 7th edition
P. 105

four from right to left. If necessary, pad with zeroes to complete the last group of four. For example,
1011101bin =0101 1101bin
=5 Dhex =
5D hex
An octal number uses base 8, and is represented with the symbols 0 – 7. On the AP exam, the representation is likely to be with the subscript oct: 132oct. In expanded form, 132oct means
(1)(82) + (3)(81) + (2)(80) = (1)(64) + (3)(8) + (2)(1)
= 64 + 24 + 2
= 90, or 90dec
Final Variables
A final variable or user-defined constant, identified by the keyword final, is used to name a quantity whose value will not change. Here are some examples of final declarations:
final double TAX_RATE = 0.08; final int CLASS_SIZE = 35;
NOTE
1. Constant identifiers are, by convention, capitalized. 2. A final variable can be declared without initializing it
immediately. For example,
final double TAX_RATE; if (< some condition >)




















































































   103   104   105   106   107