Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Mock Exam, Page 370, Question 13, C

Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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."
    Bookmark Topic Watch Topic
  • New Topic