title: catching ArrayOutOfBoundsException
body: <p>I am making a project for my school and I have handle all exceptions, but I am just not able to handle the ArrayOutOfBoundsException. 
  so I searched for a solution on stackoverflow and it says to use IndexOutOfBoundsException (link to the solution : <a href="https://stackoverflow.com/questions/7458449/why-is-it-not-catching-the-arrays-out-of-bound">why is it not catching the arrays out of bound?</a>)
   but it didnt work. please help?
  here is my code:</p>
  
  <pre><code>for (int i = 0; i &lt; 4; i++) {
      System.out.println(fruit[i] + fruitprice[i]);
  }
  System.out.println("\n" + "please enter the number marked for the icecream you want to buy");
  do {
      x = 0;
      try {
          icenum1 = Integer.parseInt( in .readLine()) - 1;
      } catch (NumberFormatException n) {
          System.out.println("please enter in numbers and not in words.... please try again");
          x = 1;
      } catch (IndexOutOfBoundsException e) {
          System.out.println("please enter a number out of the given numbers and not any other number");
          x = 1;
      }
  } while (x != 0);
  System.out.print("\u000c");
  System.out.println("your choice is " + fruit[icenum1]);
  </code></pre>