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

Can we make main() thread as daemon?

0 Answers  


What is local variable and instance variable?

0 Answers  


What is use of functional interface in java 8? Explain

0 Answers  


When we will use an Interface and Abstract class?

9 Answers  


Do I need java on my pc?

0 Answers  






Explain the difference between call by refrence and call by value?

0 Answers  


What is difference between overloading and overriding in java?

0 Answers  


What is pass by value?

0 Answers  


What are the elements of java?

0 Answers  


How do you create a reference in java?

0 Answers  


what are depricated methods ?

5 Answers   Satyam,


what is use of functional interface in java 8?

0 Answers  


Categories