Pergunta de entrevista da empresa Deloitte

What happen if we add null in TreeSet. Give the logic.

Resposta da entrevista

Sigiloso

10 de jan. de 2015

can be added if the treeset is empty because there is no object to compare with but throws null pointer exception if the ts is non empty since the comparison of null with non null object ref throws nullpointer exception.

1