Final

2
Final - is a modifer applicable or class, methods and variable. Class – we cant extend class. Cant create child class Method – cant override it in calid class Variable – becomes constant an cant perorm any assignments Finally - is a bloc which is accommodates with try!" catch !" bloc s to clean #p code $ry!" – we write ris y code where exception cam occ#r Catch!" – handling exceptions Finally – clean#p code. Closing streams, networ connection, database connection in fnally bloc Finali%e – is a method called by garbage collection &#st beore collecting eligible o

description

Final

Transcript of Final

Final - is a modifier applicable for class, methods and variable. Class we cant extend class. Cant create child classMethod cant override it in calid classVariable becomes constant an cant perform any assignmentsFinally - is a block which is accommodates with try() catch () blocks to clean up codeTry() we write risky code where exception cam occurCatch() handling exceptionsFinally cleanup code. Closing streams, network connection, database connection in finally block

Finalize is a method called by garbage collection just before collecting eligible obj.