Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Multi_Catch {
- public static void main(String[] args){
- try{
- int x=0;
- int y=50/x;
- int a[] = new int[args.length];
- for(int i = 0; i<=args.length;i++){
- a[i] = Integer.parseInt(args[i]);
- }
- }
- catch(ArithmeticException e)
- {
- System.out.println("Divide By Zero");
- try
- {
- System.out.println(a[9]);
- }
- catch(ArrayIndexOutOfBoundsException e1)
- {
- System.out.println("array out of bound");
- }
- }
- catch(Exception e)
- {
- System.out.println("Exception");
- }
- }
- }
Add Comment
Please, Sign In to add comment