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("继续运行"); } }