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

SCJP 1.5 - K&B Study Guide - Possible Mistake?  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In regards to the K&B SCJP 1.5 Study Guide-
In the Chapter 1 Self Test questions, the 5th question reads like so:
5) Which method names follow the Java Beans Std?
A. addSize
B. getCust
C. deleteRep
D. isColorado
E. putDimensions

The book says the correct answers are B,D. However, it seems like A should also be a valid answer as well. For page 9 of the book, under JavaBeans Stds specifically says that listener methods must be prefixed with the word "add" followed by the listener type. This is a seemingly petty issue, for sure, but I want to make sure I nail these kind of basic questions should they appear on the test.

Thanks for any help!
R. Matt Sampson
 
author
Posts: 8981
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Matt, we were talking about this a few days ago, addSize can't be right because you can't have a listener called Size...
 
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, perhaps option A would be correct if it was something like addSizeListener instead of addSize
 
Edisandro Bessa
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Concerning my previous post, can anyone tell me if I am correct ?

Would be option A correct if it was something like addSizeListener or addClickListener or something like that ?
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edisandro, you're right.

The key details are to be found in the JavaBeans API spec, sections 6 & 8 - the discussion Bert is referring to above is one I started.
What it comes down to is that the 'Listener Type' also has a naming convention - it has to end with the word 'Listener'.

Here's the full discussion:
JavaBeans Listener naming conventions?

Cheers,

Tim
[ February 19, 2006: Message edited by: Timothy E. Hay ]
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity, has anyone faced such question on the exam?? I believe Java beans naming convention should really not be touched upon in a SCJP exam and i guess something to the same effect has been mentioned in Kathy and Bert's book?
 
Bert Bates
author
Posts: 8981
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Abhishek,

As of the 1.5 exam you might get one or two questions concerning the JavaBean naming standards, but they are probably some of the easier questions in the whole exam.

Bert
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!