Question
Is it possible to create arrays of length zero?
Select 1 option
- A. Yes, you can create arrays of any type with length zero.
- B. Yes, but only for primitive datatypes.
- C. Yes, but only for arrays of object references.
- D. Yes, and it is same as a null Array.
- E. No, arrays of length zero do not exist in Java.
Correct Option is : A
Note
When a Java program is run without any program arguments, the String [] args argument to main () gets an array of length Zero.
PreviousNextRelated