Javatpoint Logo

What is the data structure that a Set uses to store its elements?

By: chinth*** On: Mon Apr 06 12:50:26 IST 2015     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
In Collection Quiz-1 11th one is : What is the data structure that a Set uses to store its elements?
Answer is given as Map, can you please provide description for it?
Up0Down

 
A Set is a Collection that cannot contain duplicate elements. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited. Set also adds a stronger contract on the behavior of the equals and hashCode operations, allowing Set instances to be compared meaningfully even if their implementation types differ. Two Set instances are equal if they contain the same elements.Image Created0Down

By: [email protected] On: Mon Apr 06 17:58:41 IST 2015 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No
 
A Map is an object that maps keys to values. A map cannot contain duplicate keys: Each key can map to at most one value. It models the mathematical function abstraction. The Map interface includes methods for basic operations (such as put, get, remove, containsKey, containsValue, size, and empty), bulk operations (such as putAll and clear), and collection views (such as keySet, entrySet, and values). oracle doc
Image Created0Down

By: [email protected] On: Tue Apr 07 17:44:13 IST 2015 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No