Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Exception {
- public static void main(String args[]) {
- int[] array = new int[5];
- try {
- for (int i=0;i<6;i++) {
- array[i] = i;
- }
- System.out.println(array);
- } catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Loop went too far! - " + e);
- } finally {
- System.out.println("Array value input completed.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement