A

Admin • 828.43K Points
Coach

Q. What happens if you try to access an array index beyond its bounds?

  • (A) Returns null
  • (B) Returns 0
  • (C) Compiles but throws error at runtime
  • (D) Compiles and returns garbage value
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Array

Explanation by: Admin
Java throws an ArrayIndexOutOfBoundsException at runtime.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.