• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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!