📄 myexception.java
字号:
class UserException extends java.lang.Exception
{
UserException(){
super();
System.err.println("User defined error");
}
UserException(String s){
super(s);
System.err.println("User defined error"+s);
}
};
class TestException
{
public TestException(){ System.out.println("User init");};
public void test() throws UserException{
throw new UserException();
}
};
public class MyException
{
public static void main(String[] args)
{
System.out.println("Hello World!");
try{
TestException te = new TestException();
te.test();
}catch(Exception e){ System.err.println("catched");};
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -