Sail E0 Webinar
Question
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);
}
}
Options:
A .  0
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
Answer: Option A

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers