Alain Kaufmann

Greenhorn
+ Follow
since Jun 06, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alain Kaufmann

Hi,
sorry but I  still not agree with your answer(from equivalent topics). Page 205, it is written "JavaBeans calls an instance variable a property". Moreover in table 4.5 the first rule is "properties are private". And in front of this sentence, it is written "private int numEggs;" clearly saying that the property name is numEggs. Thus, setters and getters following the JavaBeans conventions, and particularly the last one listed in table 4.5 can only be getNumEggs, and setNumEggs, eventually isNumEggs (for a boolean). getNumberEggs follows the setter/getter conventions but not the JavaBeans conventions.  

I will add that, if you consider answer C as correct just because the method starts by get, there is no reason, to consider line 18 on page 20 as wrong just because the "propert name" does not start by an uppercase. The function also starts by set!

In every case a comprehensive errata must be added. I can be:
page 206: "The name following set/get can be not related to the name of the instance variable",
or "Answer C is wrong".

But as long as we will not have a valid errata on this problem, it will stay in the top 5.

Hi,
In my Sybex book, for the answer of question 9, chapter 4 It is written that the responses are "A, C, E. [...] Options C and E follow normal getter and setter conventions. Option A is correct but the book doesn't explain this [...]". On the web site there is an errata indicated for this page: "9. The correct answer is A, C and E. But if you got C and E, give yourself credit for getting it correct. The chapter text is incorrect on this, but the exam doesn’t cover this edge case. (In fact, it doesn’t cover JavaBeans at all. That is in the book, in case it is added back in)."

There is no errata indicated on page 220 for this question. For recall this question is "which are methods using JavaBeans conventions [...]".
Answer A is: That is compliant with table 4.5 (start with get, valid for a boolean, and the property is canSwim)
Answer E is: That is compliant with table 4.5.

But I do not agree with the fact that response C is correct. This answer is It follows the rule "getter methods begin with get". But it does not follow the rule "The method name must have a prefix of set/get/is, followed by the first letter of the property in uppercase, followed by the rest of the property name".

So, for me, the following changes should be done on response C to follow the JavaBeans property:
1- rename the method in getNumberWings,
2- Or rename the property in numWings.