Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ambiguity in Kathy Sierra Question

 
Sagar Kumbhar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
there is incorrect answer for question no. 5 of Chapter 1

the question is :

Which method names follow the JavaBeans standard? (Choose all that apply.)
A. addSize
B. getCust
C. deleteRep
D. isColorado
E. putDimensions

Answer:
� 3 B and D use the valid prefixes 'get' and 'is'.
�˚ A, C, and E are incorrect because 'add', 'delete' and 'put' are not standard JavaBeans name prefixes.


but the Two minute drill of first chapter says that:

JavaBeans methods must be named using camelCase, and depending on the
method's purpose, must start with set, get, is, add, or remove.

so the option A addSize must be correct.

am I correct??
[ June 14, 2008: Message edited by: sagar kumbhar ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is already been discussed on ranch.
 
Sagar Kumbhar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Muhammad,
next time i will search first !!
 
Mujahid Al-okaidi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add should only be used for action listeners.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic