class TRYCATCH6
{
public static void main(String args[])
{
try
{
String str= null;
System.out.println(str.length());
System.out.println("IN TRY BLOCK");
}
catch (NullPointerException e)
{
System.out.println("Null Pointer 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.