import java.util.*; class Main { public static void main(String args[]) { try { int marks[]= {1,2,3,4,5}; System.out.println(marks[6]); } catch(ArrayIndexOutOfBoundsException e) { System.out.println("Please Enter Valid index Value"); } } }
Please Enter Valid index Value