异常的理解

public class TestException {
	public static void main(String args[]) {
		TestE te = new TestE();
		te.chu();
	}
}

class TestE {
	public void chu() {
		System.out.println(1 / 0);
		System.out.println(111);
	}

}

Exception in thread "main" java.lang.ArithmeticException: / by zero
at TestE.chu(TestException.java:13)
at TestException.main(TestException.java:5)
public class TestException {
	public static void main(String args[]) {
		TestE te = new TestE();
		te.chu();
	}
}

class TestE {
	public void chu() {
		try{
			System.out.println(1 / 0);
		}catch(Exception e){}
		System.out.println(111);
	}

}

111

你可能感兴趣的:(java,thread)