示例代码
public class test { public static void tryCatch(){ String a = null; try { System.out.println(a.equals("aa")); }catch (Exception e){ System.out.println("try1"); } try { System.out.println(a.equals("aa")); }catch (Exception e){ System.out.println("try2"); } System.out.println(a.equals("aa")); System.out.println("aaaaaa"); } public static void main(String[] args) { tryCatch(); } }