Programming Language › Array in Java › Question #2198
Single Choice Not Set

QWhat 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);
        }
}

ID: #2198 Array in Java 6,527 views
Question Info
#2198Q ID
Not SetDifficulty
Array in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • B Compilation error, arrays cannot be initialized to zero size. ✔ ✖
  • C Compilation error, it is a.length() not a.length ✔ ✖
  • D None of the above ✔ ✖
Correct Answer

Explanation

0

Share This Question

Challenge a friend or share with your study group.