HashSet can be used when you dont want set having duplicate values. For example - List dupInts = new List {1,3,4,5,3,3,6}; HashSet noDupInts = new HashSet(dupInts); When this will run - noDupInts will have as {1,3,4,5,6}
HashSet can be used when you dont want set having duplicate values. For example - List dupInts = new List {1,3,4,5,3,3,6}; HashSet noDupInts = new HashSet(dupInts); When this will run - noDupInts will have as {1,3,4,5,6} Hope this helps
Posted Jan 9, 2016, 6:45 AM
HashSet can be used when you dont want set having duplicate values.
For example -
List dupInts = new List {1,3,4,5,3,3,6};
HashSet noDupInts = new HashSet(dupInts);
When this will run - noDupInts will have as {1,3,4,5,6}
Hope this helps