Example & Tutorial understanding programming in easy ways.

Is it possible to have finally block without catch block?

The finally should have atleast a try block, catch is optional. The point of finally blocks is to make sure that the piece of code must be executed whether an exception is thrown or not.

A finally clause ensures that the finally block is executed after the try block and any catch block that might be executed, no matter how control leaves the try block or catch block.

Hence a finally should always be preceded by a try block.

Read More →
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!