摘要: java中的异常 1、什么时候throw可以单独使用? public static String test() throws Exception{ 13 int a = 10; 14 int b = 0; 15 try{ 16 System.out.print("前"); 17 int d = a/b; 18 ret 阅读全文
posted @ 2022-03-30 17:10 青牛梦旅行 阅读(36) 评论(0) 推荐(0)
摘要: try{}catch(){}的执行过程 情形一:catch中抛出异常,让调用方来处理 1 public class HelloWorld { 2 public static void main(String []args) { 3 System.out.println("Hello World!"); 4 String c = "wo"; 阅读全文
posted @ 2022-03-30 16:12 青牛梦旅行 阅读(202) 评论(0) 推荐(0)