31
What is the result of compiling and running the following code?public class Test{ public static void main(String[] args){ int[] a = new int[0]; System.out.print(a.length); }}
- A0
- BCompilation error, arrays cannot be initialized to zero size.
- CCompilation error, it is a.length() not a.length
- DNone of the above
Correct answer: A