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 trialVictoria Holland
6,159 PointsWhich of these sets of hashcodes should not be possible?
In one of the quizzes in the Java Inheritance unit, I was faced with this question:
"Which of these sets of hashcodes should not be possible?"
The answer turned out to be "4, 11, 7, 4, 10" but it was just a lucky guess. Can someone please explain why that set of hashcodes isn't possible?
4 Answers
Steven Parker
231,269 PointsA requirement of hashcodes is that they must all be unique, and in that list the number "4" occurs two times.
Pratham Mishra
14,191 PointsIf that's the case, then the option '1,2,3,4,5' should also be valid right? And the rest of the answers should also be valid likewise.
Steven Parker
231,269 PointsThe question asks which one "should not be possible". So all the valid ones are wrong answers.
Pratham Mishra
14,191 Pointsoh, got it! Thank you for clearing the doubt
Lee Haney
395 PointsThis question was really random. It confused me too.
jordanrose2
2,859 PointsI have no idea why they just say "Bummer! Your answer is incorrect." and not explain why, this quiz style is terrible. We are here to learn, not be graded, you can't redo the question unless you click away from it and then click back into the quiz.
Pratham Mishra
14,191 PointsPratham Mishra
14,191 Pointscan you elaborate? I didn't get what u said. What do mean by the term 'unique' exactly
Steven Parker
231,269 PointsSteven Parker
231,269 PointsThe term "unique" means that each one of them must be different from all the others.