ArrayLengthCannotBeZero
DRAFT

Misconception:

It is not possible to create an array of length 0.

Incorrect

An array cannot have a length of 0 elements

Correct

An array can have a length of 0 elements

Correction
Here is what's right.

We can allocate an array of length zero in exactly the same way we can allocate arrays of any other length:

new int[0]

And we can also use an array initializer instead of specifying the length:

new int[] {}

Origin
Where could this misconception come from?

Students might mistakenly believe that an empty array is not really an array, similar to the mistaken believe that 0 is not really a number.

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.