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 .  None of these
B .  0
C .  Compilation error, arrays cannot be initialized to zero size.
D .  Compilation error, it is a.length() not a.length
Answer: Option B

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