class TRYCATCH7
{
public static void main(String args[])
{
try
{
String str= "Sukhvir";
int i = Integer.parseInt(str);
System.out.println("IN TRY BLOCK");
}
catch (NumberFormatException e)
{
System.out.println("Number Format Exception");
}
catch (Exception e)
{
System.out.println("Exception occurred");
}
System.out.println("OUT OF TRY CATCH BLOCK");
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.