Java Multiple Catch Exception

https://‮‬www.lautturi.com
Java Multiple Catch Exception
/**
 * @author lautturi.com 
 * Java example: catch Multiple Exceptions in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		try {
			int array[] = new int[3];
			array[5] = 12/2; 
			// array[5] = 12/0;
		} catch (ArithmeticException e) {
			System.out.println(e);
		} catch (ArrayIndexOutOfBoundsException e) {
			System.out.println(e);
		}
	}
}

output:

java.lang.ArithmeticException: / by zero

java.lang.ArrayIndexOutOfBoundsException: 5
Created Time:2017-09-27 14:01:20  Author:lautturi