asked in Exception by (58.6k points)

1 Answer

Fresher and experienced java developers must be well versed with this exception handling interview question in java.
try or try-catch block can be followed by finally block in java >

    try-finally block, or

 try{
              //Code to be enclosed in try-finally block
       }finally{
       }   

    try-catch-finally block.

       try{
              //Code to be enclosed in try-catch-finally block
       }catch(Exception e){
       }finally{
       }

finally block can can only exist if try or try-catch block is there, finally block can’t be used alone in java.
answered by (58.6k points)

Java Interview Questions and Answers 2018

...