A

Admin • 828.70K Points
Coach

Q. What is the output of the following code?

Code:
int[] arr = new int[5];
System.out.println(arr[0]);
  • (A) 0
  • (B) null
  • (C) Compiler error
  • (D) Undefined
  • Correct Answer - Option(A)
  • Views: 17
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
The default value of an int array is 0.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.