Arrays in java are fixed in length. Why does Java allow arrays of size 0 then?
String[] strings = new String[0];
Another case where a zero length array can be useful: To return an array containing all of the elements in a list :
T[ ] toArray(T[ ] a)
A zero length array can be used to pass the type of the array into this method. For example:
ClassA[ ] result = list.toArray(new ClassA[0]);
A zero length array is still an instance of Object which holds zero elements.