Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 12
    This explanation is not convincing, considering that LinkedList also supports null list entries. Commented Jul 16, 2014 at 11:50
  • 12
    Yea ... but a simpler and (IMO) more plausible explanation is that allowing null entries is useful in a lot of cases. Commented Jul 21, 2014 at 22:48
  • 7
    ArrayList isn't called like that because it mimics an array. It is called like that because it is a list implemented as an array. Just as a TreeMap doesn't behave like a Tree. Commented Sep 14, 2014 at 6:38
  • 12
    This answer, IMO, is just plain wrong. Nulls are allowed because in Java, for better or worse, (IMO, worse) null gets used a lot to represent uninitialized or missing values. How did it get the most votes and the "accept" check? Seriously, I'm really losing faith in StackOverflow these days. Commented Sep 15, 2014 at 18:13
  • 9
    This answer is plain wrong. This is just unsupported guesswork about nulls being allowed in a list implementation. Here is a roundup of Java collections allowing/disallowing nulls; notice how it has nothing to do with similarity to arrays. Commented Oct 9, 2014 at 12:37