how to throw an IOException?

前端 未结 7 1745
天涯浪人
天涯浪人 2020-12-19 04:17
public class ThrowException {
    public static void main(String[] args) {
        try {
            foo();
        }
        catch(Exception e) {
             if (e         


        
7条回答
  •  遥遥无期
    2020-12-19 04:56

    static void foo() throws IOException {
        throw new IOException("your message");
    }
    

提交回复
热议问题