Robert

60%
Flag icon
In summary, never return null in place of an empty array or collection.
Robert
Never say never: There are exceptions—very few, to be fair—where null can be used to communicate something different from empty. For example, null can be used to indicate that there is no value (where the value is a list of values) stored in the map or key-value store yet (and where storing an empty array may not be desirable).
Effective Java
Rate this book
Clear rating
Open Preview