Home / Programming MCQs / JAVA MCQs / Question

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

Explanation:

The default value of an int array is 0.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.