Throw checked exceptions are multiple methods

WE Package; 

Import java.io.IOException; 
public class ThrowMultiExceptionsDemo { 
    public static void main (String [] args) 
        { 
      the try { 
            throwsTest (); 
       } 
        the catch (IOException E) { 
            System.out.println ( "exception capture"); 
        } 
    } 

    Private static void throwsTest () throws an ArithmeticException, IOException { 
        System.out.println ( "this is just a test"); 
        // assume abnormal program processing 
        the throw new new IOException (); 
        // the throw an ArithmeticException new new (); 
    } 
}

 

 

Guess you like

Origin www.cnblogs.com/yyl141/p/11789335.html