/************************************************************************* * * Demonstrates the finally block * *************************************************************************/ public class ExceptionDemo { public static void main(String[] ags) { try { int[] array = new int[1]; array[12] = 6; } catch(ArrayIndexOutOfBoundsException e) { System.out.println("array index " + e.getMessage() + " is out of bounds"); } finally { System.out.print("this will always execute"); } } }