In HashSet duplicates are allowed while adding to the HashSet,
but while retreiving the object from HashSet is not shown the
duplicate values, WHY ?

Answer Posted / shashi

Because HashSet class will override equals and hashcode method internally.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of ways where you can iterate over a list? : java collections

578


Which java collection class can be used to maintain the entries in the order in which they were last accessed?

564


How do I find jre path in windows?

531


What are the different types of features of the java collections framework? : java collections

578


What is an algorithm in java collection framework? : java collections

583






who will give req's to u?. how they send req's to u? . what design documents contains?. when bugs raised on other developer code how to report to them?.(throgh mail or ........). how to retrive 100 recods from dao layer to presentation layer.using which collection?. what is sequence diagram.?.

1820


What do you understand by synchronization? Why is it important?

576


what is mean by hasing and maping in java platform and advantage?

1835


Hi we have an urgent requirement for Java/J2ee technical lead position & also looking for "Java Guidewire claimcentre" experienced professional for Bangalore location if interested can reach srisanh@gmail.com

2542


What are the types of interface used in the java collections? : java collections

591


What are the main classes of the list interfaces? : java collections

580


What are the interfaces in java collections? : java collections

618


Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword

1616


What is the enumerator of the java collection framework? : java collections

567


What is the difference between comparable and comparator in java.util pkg?

594