package com.hanqi; public class TestError { public static void main(String[] args) { try { int i = 2/0; } catch(Exception ex) { ex.printStackTrace(); //处理异常 System.out.println("异常信息:"+ ex.getMessage()); } System.out.println("继续运行"); } }
转载于:https://www.cnblogs.com/0927wyj/p/5042383.html