80.3k views
4 votes
The Java compiler does not check for an ArrayIndexOutorBoundsException during the compilation of a program containing arrays. O True O False

1 Answer

2 votes

Answer:

TRUE

Step-by-step explanation:

  • Let us first understand what is an ArrayIndexOutOfBounds Exception.
  • As the name itself suggests the index for the array has gone out of bound (permissible value) and an exception (anamoly) is resulted.
  • So, it throws an error.
  • That means if an array, Employee of size n is defined then the permissible elements are Employee[0] to Employee[n-1]. If any negative index or with the index is greater than n-1 is tried to access it throws an error saying ArrayIndexOutOfBounds Exception.
  • In java, during the compilation of the program the compiler doesn't check for the ArrayIndexOutOfBounds Exception.It checks during running the program.
  • So, it is called a Runtime Exception.
User Nidya
by
5.3k points