June 2012
Intermediate to advanced
288 pages
6h 48m
English
final Variables
A final
variable, also called a “constant,” is a variable whose value you can’t change after it’s been initialized. For example, you might use a final variable to define a constant value, such as pi. To declare a final variable, you add the final keyword to the variable declaration, like this:
static final int WEEKDAYS = 5;
Although it isn’t required, adding the static keyword is common for final variables.
Read now
Unlock full access