整体理解异常和错误
什么是异常
异常结构体系分类
Error
Exception
代码
package com.zhan.base06Exception.demo01;
public class Test01 {
// 异常
public static void main(String[] args) {
System.out.println(10/0); // 异常 Exception in thread "main" java.lang.ArithmeticException: / by zero
a(); // 异常 Exception in thread "main" java.lang.StackOverflowError
}
static void a(){
b();
}
static void b(){
a();
}
}
标签:Exception,01,错误,void,理解,static,main,异常
From: https://www.cnblogs.com/zhanjianhai/p/17120204.html