class NestedTry1 { 
	public static void main(String args[]){ 
        	// initializing array 
        	int a[] = { 1, 2, 3, 4, 5 }; 
        	try{
			// trying to print element at index 5 
            		System.out.println(a[5]); 	// in next run make this a[3]  
  
            		// try-block2 inside another try block 
            		try{ 
  
                		// performing division by zero 
                		int x = a[2] / 0; 
            		}catch (ArithmeticException ae){ 
                		System.out.println("division by zero is not possible -> " +ae); 
            		}
		}catch(ArrayIndexOutOfBoundsException aioobe) { 
            		System.out.println("ArrayIndexOutOfBoundsException -> " +aioobe); 
            		//System.out.println("Element at such index does not exists"); 
        	} 
    	} 
    
} 
