A

Admin • 831.35K Points
Coach

Q. What will this print?
int[] a = new int[3];
a[1] = 5;
System.out.print(a[1]);

  • (A) 0
  • (B) 5
  • (C) null
  • (D) 1
  • Correct Answer - Option(B)
  • Views: 21
  • Filed under category Java
  • Hashtags: Java Array

Explanation by: Admin
The value at index 1 is set to 5, so it prints 5.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.