Finally block

  • Eclipse: Oxygen
  • Java: 1.8

The finally block is the block which always gets executed no matter the programs throws an exception or not. But we have to follow some basic conditions that the catch blocks always is after the throw block.

This could be used to execute an important segment of code we always want the compiler to execute no matter what is the state of the exception.

App class

Output

We don’t know, what will be the outcome 1
This will be get printed

Contributed by Poonam Tomar


VIEW COURSES

Buy me a coffee!

 

PayTM QR (INDIA)

  • Get video tutorials
  • Project files set
  • Get┬áCertified

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu