Stephan Stephan - 1 year ago 114
Java Question

How to workaround this JDK limitation?

I'm looking for a class from the Java Collection Framework that would not allow null elements.

Do you know one?

Answer Source

Most Queue implementations (with the notable exception of LinkedList) don't accept null.

EnumSet is a special-purpose Set implementation that doesn't allow null values.