Explain Try statement

Try statement: The try statement performs as an exception handler - a position where exception objects are caught and dealt with. In its most common form, it comprises of a try clause, one or more catch clauses and the finally clause.

    try{
        statement;
        ...
    }
    catch(Exception e){
        statement;
        ...
    }
    finally{
        statement;
        ...
    }

Either of the catch and finally clause might be omitted, however not both.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.