Exaplain about final,finally,finaliz in Java
final :
final is modifier in java which is used for variable,method and class.
1 :if declare variable as final that variable becomes a constant means we can not change the value of that variable.
2 :if declare method as final that means we can not override that method in subclass i.e we can not provide the method body into the subclass.
3 :if we declare class as final means we can extends that class.i.e.we can not inherit that class into subclass
finally :
finally is block which is associated with try - catch for resource deallocation.finally is block which 100% excute if any Exception raise or not.if any resource allocated that deallocation code we write into the finaaly block.
finalize :
finalize is a method of object class is also used for deallocation of object.that method is automatically callad by object.if any object going to Garbadge Collection before object going to Garbadge Collection the fialize method is callad for resource deallocation of object.i.e means database connection any network connection allocated that resource are deallocated into the finalize method.