Sunday, 4 December 2016

Java - Syntax for Exception Handling

syntax to try,catch and finally block:-
try
   {
        set of exe sts;
        .
        .
        if(condition)
        throw new classname();//optional
        throw new classname("args");//optional
        .
   }
catch(childclassname oname)
   {
        .
   }
.
catch(baseclassname oname)
   {
        ………..
   }
finally
  {
        write statements;

  }

No comments:

Post a Comment

Featured post

Development Of JAVA Program