File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

some odd answers from the K&B CD - part 3

 
John Schubert
Ranch Hand
Posts: 39
Android Java
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another cup of my favourite answers! This is question #53 from the first exam in K&B's CD.
The question presents a series of conditions over some object instances of unknow type, named x1, x2, x3, x4, x5 and x6. I'll skip the irrelevant stuff and post an equivalent question:


Given:
...
x5.equals(x6) == true
...

Which of the following statements will always be true? (Choose all that apply):
...
x5.hashCode() == x6.hashCode()
...


That answer was considered the correct and the others were all incorrect. But either the question is formulated wrongly or the answer is not correct.

We can clearly have a class where two equal objects have different hashCodes:



So the question should have rather been: "Which, according to the hashCode contract, should be always true?".Some questions are extremely picky on its language and others are leaving so much up to supposition. Not fair!
 
dennis deems
Ranch Hand
Posts: 808
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Schubert wrote:So the question should have rather been: "Which, according to the hashCode contract, should be always true?".Some questions are extremely picky on its language and others are leaving so much up to supposition. Not fair!


I have to tell you, it is very reassuring to see someone else expressing the reactions I had after taking the mock exams. If it helps, I don't remember anything on the exam even remotely approaching the level of ambiguity we find in some of the mock questions.
 
John Schubert
Ranch Hand
Posts: 39
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dennis Deems wrote:If it helps, I don't remember anything on the exam even remotely approaching the level of ambiguity we find in some of the mock questions.


It helps
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

On the one hand, I think the question should be worded better...

On the other hand, I think you're going overboard a bit. In the old days the real exam might have tried to "trick" you like that, but it's just not that way any more. The exam does sometimes focus on important details, but not in a "tricky" way. Perhaps you've looked at other mock exams that rely on tricks? The real exam focuses on important stuff, it doesn't rely on tricks.

hth,

Bert
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic