MCQOPTIONS
Saved Bookmarks
| 1. |
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); } } |
| 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» B. Compilation error, arrays cannot be initialized to zero size. | |