This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Chandana Garlapati wrote:Which method names follow the JavaBeans standard? (Choose all that apply.)
This question is from k&B.
the answer is only 2 and 4 options.
why not 1st option??
can anyone explain??
Because of JavaBeans Standard.
getStopped() or isStopped() are both valid JavaBeans names for a boolean property.
getSize()is a valid JavaBeans getter name for a property named
"size." Keep in mind that you do not need to have a variable named size
1) is not valid as per JavaBeansStandard.
There is javabean listner naming rule where Listner word is required.
addSizeListener(SizeListener sl) is good as per Javabean Listner naming rule.