This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes JavaBean method names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "JavaBean method names" Watch "JavaBean method names" New topic

JavaBean method names

R. Grimes
Ranch Hand

Joined: Aug 23, 2009
Posts: 42
On page 68, under the "Two Minute Drill" section, Objective 1.3, it states:

"JavaBeans must be named using camelCase, and depending on the methods proposed, must start with set, get, is, add, or remove."

Then, on the same chapter's Self Test Answers, page 79, question 2 asks:

"Which method names follow the JavaBeans standard?

A. addSize
B. getCust
C. deleteRep
D. isColorado
E. putDimensions"

You state that "A is incorrect because 'add' can be used only with Listener methods."

Seems misleading.

Ron Grimes
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 802

You may get help from here. See this discussion

SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
I agree. Here's the link:
subject: JavaBean method names
It's not a secret anymore!