<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.io.*;
/** Illustrates points about exceptions */
public class Ex {
    
    public static void first() throws IOException {
        second();
    }
    
    public static void second()  throws IOException {
        third();
    }
       
    public static void third() throws IOException {
       throw new IOException();
    }

    
    /** = array of n -1Õs.  Throws an  IllegalArgumentException if n &lt;=0*/         
    private static int[] initArray(int n) {    
       
        if (n &lt;= 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&lt;n; i= i+1) {
            b[i]= -1;
        }
        return b;
    } 
    
}</pre></body></html>