12345678910111213141516171819202122232425262728293031323334353637 |
- package com.four.day12.demo02;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- public class Demo03 {
- public static void main(String[] args) {
- //
- try {
- //int i= 1/0; // ArithmeticException
- //String s = null; //NullPointerException
- //s.equals("1");
- int[] arr= new int[1];
- arr[1] = 0;
- }
- // catch (ArithmeticException e1){
- // e1.printStackTrace();
- // }catch ( NullPointerException e2 ){
- // e2.printStackTrace();
- // }
- catch (RuntimeException e3){
- //范围
- e3.printStackTrace();
- }
- }
- }
|