• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

re: SCJP for Java 5 Study Guide - JavaBeans Standard

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 68 (Two-minute Drill) it states,JavaBeans methods must be named using camelCase, and depending on the method's purpose, must start with set, get, is, add, or remove. On page 78, Question 5 (Self-Test) says that answer A. addSize is incorrect. This is contradictory. How should that question be answered and why?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As specified by the answer, add and remove can only be used for listeners: addActionListener, removeMouseListener, etc.
I do agree that the 2min drill is incomplete, but if you've read the entire chapter you would have seen that it is told, and you could've answered the question correctly.
 
Bill Fly
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob, add and remove are valid Listener method names per the JavaBean spec. Therefore, I think the answer for the question given by the book is incomplete. A is as good an answer as the othe two. Page 9 says For the exam, you need to know that the methods that are used to add or remove listeners from an event must also follow JavaBean naming standards.
[ October 16, 2007: Message edited by: Bill Fly ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic