This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi Rajesh A Set can not have duplicate values. While a map's Value can be duplicate but it's key can not be. Let's take an example. Consider the roll No. used in schools/colleges etc. Here the roll no. is unique but the name may or may not be unique. So this is an example of a map where the name is the value(may be repeated) and roll no. is the key(unique). You can consider a set as one, only containing values and that too unique. Consider the set of all the english alphabets(A-Z). In this set we have only unique elements that is no alphabet can be repeated. Hope that helps. Repost if it doesn't. [ June 29, 2003: Message edited by: Anupam Sinha ]
Map: Key/value pair. One implementation of Map interface allow null key/values (hashmap) and others don't (hashtable). duplicate keys are not allowed. Set: when you see a Set, think of no duplicates. HTH [ June 29, 2003: Message edited by: Andres Gonzalez ]
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury