lMinor
Differences
•No const – instead
we use “final” to represent memory that cannot be changed
•final int I = 10; //a
constant value
•final list object = new list(); //reference is constant – so it can’t reference another object! However, the object itself can
be modified
•This means that class objects in fact can’t be
constant!
•Final doesn’t
require that the value of the variable/object be known at compile time
final list obj; //says it is a
“blank” final reference
•Blank finals must
be initialized in the constructor where the blank final is a member
•Arguments can also
be “final” by placing the keyword in the argument list – which means the method cannot change the
argument reference