empty-list

return nothing , using array == null or array.length == 0 ?

Supposing I have a function with following signature: Foo[] getSomeFoos() { //return null --- option A or //return new Foo[0]; --- option B } What is the recommended practice to return the value indicating there is no elements returned? Any pros or cons for each option? ...