Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
102 views
in Technique[技术] by (71.8m points)

java - 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?

question from:https://stackoverflow.com/questions/6997142/how-to-workaround-this-jdk-limitation

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...