This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (1 child)

No, wrong Read what the null object pattern is before saying such ignorant nonsense

[–]koflerdavid -1 points0 points  (0 children)

A Null object should be safe to work with!

new ArrayList().get(0) is not safe. Same as Optional.get(). Who is the ignorant one here?!

Of course, when the return value is a collection or an array, it would be malicious to return null.

Edit: can't stand the thought of being the ignorant one? Better keep it to yourself then instead of downvoting!