Example & Tutorial understanding programming in easy ways.

15.point to be remember keyword final.

Points to be Remember:

a) A final method cannot be overridden.

b) A final class not be inherited.

c) We cannot change the value of a final variable.

d) A constructor cannot be declared as final.

e) Local final variable must be initializing during declaration.

f) All variables declared in an interface are by default final.

g) If method parameters are declared final then the value of these parameters cannot be changed.

h) It is a good practice to name final variable in all CAPS.

i) final, finally and finalize are three different terms. finally is used in exception handling and finalize is a method that is called by JVM during garbage collection.
  

Read More →