• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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."
--Dale--
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic