final, finally, finalize

  • Final is used to apply restrictions on class, method,variable
  • Final class can not be inherited, final method can not be over ridden, final variable can not be changed
  • Finally is used mostly with try catch in exception handling
  • it is used to execute the code which needs to be executed irrespective of the exception
  • Ex , closing db connection
  • finalize is used to clean up processing before object is garbage collector

Leave a Reply