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
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0
Explanation: The default value of an int array is 0.
Explanation by: Deepak Sahoo
The default value of an int array is 0.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
182
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Deepak Sahoo
Publisher
πŸ“ˆ
84%
Success Rate