class TRYCATCH2
{
public static void main(String args[])
{
try
{
int [] A={1,2,3,4,5};
int B = A[5];
System.out.println(B);
System.out.println("IN TRY BLOCK");
}
catch (ArrayIndexOutOfBoundsException e)
{
System.out.println("Index Out of Bound Error");
}
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.