A

Admin • 825.56K Points
Coach

Q. What will be the output?
int[] arr = {1, 2, 3};
System.out.print(arr[1]);

  • (A) 1
  • (B) 2
  • (C) 3
  • (D) IndexOutOfBoundsException

Explanation by: Admin
arr[1] accesses the second element, which is 2.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.