File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes JavaBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "JavaBeans" Watch "JavaBeans" New topic
Author

JavaBeans

Chandana Garlapati
Ranch Hand

Joined: Jul 06, 2009
Posts: 97
Which method names follow the JavaBeans standard? (Choose all that apply.)

1) addSize

2) getCust

3) deleteRep

4) isColorado

5) putDimensions

This question is from k&B.
the answer is only 2 and 4 options.
why not 1st option??

can anyone explain??
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Chandana Garlapati wrote:Which method names follow the JavaBeans standard? (Choose all that apply.)

1) addSize

2) getCust

3) deleteRep

4) isColorado

5) putDimensions

This question is from k&B.
the answer is only 2 and 4 options.
why not 1st option??

can anyone explain??


Because of JavaBeans Standard.

getStopped() or isStopped() are both valid JavaBeans names for a boolean property.
getSize()is a valid JavaBeans getter name for a property named
"size." Keep in mind that you do not need to have a variable named size

1) is not valid as per JavaBeansStandard.

There is javabean listner naming rule where Listner word is required.

addSizeListener(SizeListener sl) is good as per Javabean Listner naming rule.


Rajeev Kumar
SCJP 6.0 Certified 96%
Chandana Garlapati
Ranch Hand

Joined: Jul 06, 2009
Posts: 97
Thanks Rajiv.
 
wood burning stoves
 
subject: JavaBeans