Computer Scientists are Pretty Pessimistic

Sunday 28 August 2016

Final Keyword

final variable :-

When a variable declared as final it's value never be changed next time .

final method :-

When a method declared as final it can be overridden .

final class :-

To prevent a class from being inherited the class need to declared as final.

finally block :-

A finally block is a block of code that will be executed after a try/catch block has completed and before the code following the try/catch block . The finally block will execute whether or not an exception is thrown . If an exception is thrown. the finally block will execute even if no catch statement matches the exception .

finalize method :-

When an object is no longer used, it is called "garbage" . The function of the "garbage collector" is to determine objects which are no longer used and reclaim the memory occupied by the object .

No comments:

Post a Comment