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]…

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);
    }
}
  1. a) 0
  2. b) Compilation error, arrays cannot be initialized to zero size
  3. c) None of the above
  4. d) Compilation error, it is length () not length

From the BB Assistant Programmer February 2023 – Written (BIBM) exam, question 17 of 37.

More from this paper