📄 exceptionmethods.java
字号:
//使用printStackTrace()就可以把调用堆栈的的轨迹打印出来
public class ExceptionMethods
{
public static void main(String[] aa)
{
try
{
throw new Exception("Here's my Exception");
}
catch(Exception e)
{
System.out.println("Caught Exception");
System.out.println("e.getMessage(): "+e.getMessage());
System.out.println("e.toString():"+e.toString());
System.out.println("e.printStackTrace():");
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -