Final vs Finally vs Finalize #java #javaprogramming

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Informative bro, Thank you for these videos. We need more such shorts.

Keep hustling🎉

jasondsouza
Автор

No necessarily finally should follow the catch block. We can have only try and finally without catch block.

adhilJ
Автор

Hi sir i have two questions for you


Like can we call static method from non static method

Can we can non static method from static method

prashanthReddy-lu
Автор

Cam we throw the exception from finaly block ? It was asked one of the interview....

Yes we can throw the the exception from but if exception already throws from try or catch block then the finally block will replace that original exception then we may loos of orginal exception...its actually not recommended unless you really needed

The orginal exception from try or catch block will be suppressed or ignored and the exception from finally will be printed

Finally block always execeted regardless of exception....if we wan to stop the execution of final block we just have to call system.exit() it will prevent tge exccution of finally block

prashanthReddy-lu
Автор

finalize don't cause performance issue, On garbage collection it's executions is not guaranteed

p...p
welcome to shbcf.ru