Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam, Page 370, Question 13, C

 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The text from "C" seems to have been pulled directly out of the spec (page 203). You would think that would be the end of it, but that quote is under the section for "Primary key that maps to multiple fields...".
My thinking on that question went like this.... I can pick any class for my key that has a valid equals and hashcode. Something like Calendar came to mind. I figured Calendar had bunches of private fields, so "C" didn't get checked.
Looking at the spec, it says "there are two ways to specify a primary key class", so just the terminology "primary key class" as listed in "C" is not enough to know they are referencing a multiple field key class.
So IMHO, where it says "C. All fields in the primary key class must be declared public." it should say "C. All fields in the primary key class using multiple fields must be declared public."
--Dale--
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic