You are on page 1of 1

Java allows declaration of

1) classes
2) methods
3) variables
as "final".
final class
----------
A final class is a class that cannot be inherited.
(see FClass.java)
final method
------------
A final method is a method that cannot be overridden.
(see FMethod.java)
final variables
-------------
a) final local variable
--must be assigned a value once.
--can be read any number of times.
--cannot be reassigned.
b) final formal parameter
--can be read any number of times.
--cannot be assigned.
c) final member variables
--must be assigned a value only once either through an intializer or a construct
or.
--can be read any number of times.
--cannot be reassigned.
(see FVariables.java)

You might also like