集册 Java实例教程 分析异常的printStackTrace()方法的输出

分析异常的printStackTrace()方法的输出

欢马劈雪     最近更新时间:2020-01-02 10:19:05

465
分析异常的printStackTrace()方法的输出

public class Main {

  public static void main(String[] args) {

    startProcess();
    /* from 
    N o w  J a v a  . c o m*/

  }


  private static void startProcess() {

    try {

      int a = 5 / 0;

    } catch (Exception e) {

      e.printStackTrace();

    }


  }

}