This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In that example there's no clear reason, but then it's only meant to show the syntax of arrays and not their justification.
Arrays are nice for grouping sets of similar data together and passing them as one. Say you have a method that prints a set of data but you don't know when writing the method how large that set is going to be. You could use an array to pass the data into that method and loop over it.
the effort to expand from 4 fields to 5 would be pretty big, potentially affecting many methods in your system. I worked with a mainframe system with a count of "7" coded so many places it could never be changed to "8". The effort to expand the array and loop is much smaller ... just resize the array. The effort to expan a collection is even less, but beyond today's example
So back to "zero, one, infinity" ... if you're going to have more than one of something, think about supporting "any number" of something.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi