This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Is this wrong?(Doubt in K&b, ch-1)  RSS feed

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 2 minute drill of K&B ch-1 has javaBeans method's as starting with set,get,is,add or remove. but question 5 of the same chapter has only getcust, isColorado as method names which follow the javaBeans naming standard. How come option1, addSize isnt chosen?
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The syntax of registering a listener XXXListenerType is as below:

addXXXListenerType();

e.g.,

addMouseListener() for a listener that implements MouseListener interface,

addMouseMotionListener() for a listener that implements MouseMotionListener interface.

addSize() does not follow above convention. size is not any listener. Second it does not have a suffix Listener in the end.

JavaBeans Specification:


- Naseem
[ August 26, 2006: Message edited by: Naseem Khan ]
 
Amit Batra
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I was really confused about this.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!