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("继续运行"); } }
时间: 2024-12-12 17:00:21