int[] a = {3, 1, 4, 1, 5};
System.out.println(a.length);What is printed?
- A
4
- B
6
- C
0
- Dcheck_circle
5
Explanation
The initializer list has 5 elements, so a.length is 5. Note: array length uses the field a.length (no parentheses), not the method a.length().