/** Illustrates points about exceptions */
public class Ex {
    
    public static void first() {
        second();
    }
    
    public static void second() {
        third();
    }
       
    public static void third() {
        int x= 5/0;
    }

    
    /** = array of n -1Ős.  Throws an  IllegalArgumentException if n <=0*/         
    private static int[] initArray(int n) {    
       
        if (n <= 0) {            
            throw new IllegalArgumentException("initArray: bad value for n, namely "   + n);      
        } 
    
        int[] b= new int[n];
            
        //inv: b[0..i-1] are -1
        for (int i= 0; i<n; i= i+1) {
            b[i]= -1;
        }
        return b;
    } 
    
}