What happens when you insert null in a TreeSet?

Last Updated :
Discuss
Comments

What happens when you insert null in a TreeSet?


null is allowed and stored

null is ignored


It throws NullPointerException

TreeSet converts null to an empty string


Share your thoughts in the comments