fullconstructors.java~1~

来自「银行管理系统,根据实习的要求以及参考现实中的银行数据库系统」· JAVA~1~ 代码 · 共 30 行

JAVA~1~
30
字号
package bank;

class myexception extends Exception{
public myexception(){}
public myexception(String msg){super(msg);}
}
public class fullconstructors{
        public static void f() throws myexception{
                System.out.println("throw myexception from f()");
                throw new myexception();
        }
        public static void g() throws myexception{
                System.out.println("throw myexception from g()");
                throw new myexception("originate");
        }
        public static void main(String[] args)
        {
                try{
                        f();
                }catch(myexception ex){
                        ex.prinStackTrace();
                }
                try{
                        g();
                }catch(myexception ex){
                        ex.prinStatckTrace();
                }
        }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?