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.

Output

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

This will be get printed

Contributed by Poonam Tomar


Full stack Java Developer

   Buy me a coffee!

 

PayTM QR (INDIA)

Download file

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu