摘要: 阅读全文
posted @ 2023-10-21 12:06 liuxuechao 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 例如: 运行之后会抛出 阅读全文
posted @ 2023-10-21 12:01 liuxuechao 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 以上便是Java中异常的基本代码结构,其中,Java中所有异常都派生于excption 以下是jdk中与异常相关的类。 阅读全文
posted @ 2023-10-21 11:43 liuxuechao 阅读(2) 评论(0) 推荐(0) 编辑
摘要: eg: import javax.swing.*;class AboutException { public static void main(String[] a) { int i=1, j=0, k; k=i/j; try { k = i/j; // Causes division-by-zer 阅读全文
posted @ 2023-10-21 11:36 liuxuechao 阅读(1) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class Main { public static void main(String[] args) { String grade; int num; Scanner sc = new Scanner(System.in); gra 阅读全文
posted @ 2023-10-21 11:28 liuxuechao 阅读(1) 评论(0) 推荐(0) 编辑