aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Error in Book Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Error in Book "SCJP Study Guide for Java 5" ?" Watch "Error in Book "SCJP Study Guide for Java 5" ?" New topic
Author

Error in Book "SCJP Study Guide for Java 5" ?

Tommaso Nuccio
Ranch Hand

Joined: Dec 11, 2006
Posts: 66
Hi all,

I am not sure on this issue, any help appreciated.

I bought the book "SCJP for Java 5" by k. Sierra and B.Bates and read through the first chapter. It is a extremly good book. Reading through other books that try to prepare you for the exam are not even worth looking at...seriously!

So I took the first SelfTest and when comparing the answers, I got confused on question 5 that deals with JavaBeans standard.
It says:
Which method names follow the JavaBeans standard?
A. addSize
B. getCust
C. deleteRep
D. isColorado
E. putDimensions

My answers are: A,B,D, because in the "Two-minute Drill" on page 68 it says:
"JavaBeans methods must be namend using camelCase, and depending on the methods purpose, must start with set, get, is, add or remove."

But the correct answer says only B,D. This is also ok for me, cause it is written down this way on pages 8 and 9.

So what is correct now and what is it for the exam?

Many thanks in advance for help.

Regards,
Tommaso


Ciao,<br /> Tommaso<br /> <br />~*~*~*~<br />There are 10 types of people, those who understand binary and those who don't.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
This is a well known error. A is not valid because it should be addSizeListener (whatever a SizeListener would be). The prefix add is always used with a prefix of Listener. The book should be corrected by now. See the K & B errata link at the top of the SCJP forum.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Tommaso Nuccio
Ranch Hand

Joined: Dec 11, 2006
Posts: 66
Thank you, Barry

As it seems, I have the revised Version of the book, i.e. all the errors described in the "K&B errata" thread are corrected in the book I have.

But I thought that "add" and "remove" are listener specific method prefixes. Everything is fine now and the confusion is gone.

Bye,
Tommaso
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Error in Book "SCJP Study Guide for Java 5" ?
 
Similar Threads
SCJP 1.5 - K&B Study Guide - Possible Mistake?
K&B Chapter 1 Question 5
JavaBeans naming standard (SCJP for Java 5)
Ambiguity in Kathy Sierra Question
contradictory statements