Q. What is the output of the following code?
Code:
int[] arr = new int[]{1, 2, 3, 4, 5};
System.out.println(arr.length);
β
Correct Answer: (A)
5
Explanation: The length property of an array returns the number of elements in the array.