Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Rodger Voelkel
Rodger Voelkel
21,736 Points

This question looks like it has a typo or am i wrong?

After running this code, there will be________ bird names in the HashSet.

HashSet birds = new HashSet();

ids.Add("Sparrow"); ids.Add("Crow"); ids.Add("Starling"); ids.Add("Finch"); ids.Add("Crow"); ids.Add("Raven"); ids.Add("Starling");

This is in the C# Collections Sets and Dictionairies in the quiz for Hash Codes and Object Equality. To me I figured the answer was zero since the Hashset named birds never has any objects added to it. All of the adds are being done to an object named ids. Am i wrong in my understanding?

Simon Coates
Simon Coates
28,694 Points

It looks like a mistake to me. It accepts 5, i think. (for the reference of anyone else looking at this forum entry, the URL is https://teamtreehouse.com/library/c-collections/sets-and-dictionaries/hash-codes-and-object-equality )

1 Answer

Steven Parker
Steven Parker
231,124 Points

Good catch. :+1:

I totally overlooked that when taking the course myself.

Be sure to submit a bug report to Support. It might even get you the "special Exterminator badge". :beetle: