1 异常的分类
2 常见的的异常举例
代码:
package com.qfedu.test02;
/**
* @author: lcw
* @createDate: 2022-10-31 9:48
* @description:
*/
public class Test01 {
public static void main(String[] args) {
//NullPointerException
Test01 t1 = null;
//t1.a();
//ArrayIndexOutOfBoundsException
Integer[] arr1 = {1,2};
//int aa = arr1[10];
//NumberFormatException 数据格式异常
//Integer i = Integer.valueOf("我");
//ArithmeticException 算术异常
int a = 1/0;
}
public void a() {
}
}