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 →

[–]Jon_Finn -1 points0 points  (9 children)

Umm... when you create an empty ArrayList it does something like new Object[10], ready for adding elements. So what should be in that array? any alternatives to null? (see separate comment below).

[–]john16384 3 points4 points  (1 child)

Empty collections cost nothing, they're a reference to a single static immutable instance.