In treeset we add same object ...what will be the out put

Answers were Sorted based on User's Feedback



In treeset we add same object ...what will be the out put..

Answer / ramamurthy

Output will be in display natural sorted order, which
doesn't contail duplicates

Is This Answer Correct ?    3 Yes 0 No

In treeset we add same object ...what will be the out put..

Answer / mohit

A Set is a Collection that cannot contain duplicate elements...TreeSet is also a set so it will not keep duplicate items....it will show only unique values....

Is This Answer Correct ?    3 Yes 1 No

In treeset we add same object ...what will be the out put..

Answer / srikanth

it remove the duplicates and print the unique values

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is stringtolennizer with example?

2 Answers   Symphony,


How to create a thread in java?

0 Answers  


What is difference between static class and singleton pattern?

0 Answers  


Difference between flush() and commit() in hibernate?

2 Answers   Bally Technologies,


How to avoid the runtime exception ?

2 Answers  






What is close method? How it's different from Finalize & Dispose?

0 Answers   InfoAxon Technologies,


Is java a virus?

0 Answers  


How do you create a sop?

0 Answers  


what is the logic inside any default constuctor?

2 Answers  


Why convert an applet to an application?

0 Answers  


Is int a class in java?

0 Answers  


What is singleton class in java and how can we make a class singleton?

0 Answers  


Categories