In table 3.4, the first should have a boolean return type. The second to last row should return E, not void.
In table 3.4, the 1st (add(E element)) should have a boolean return type. The 6th (remove(int index)) should return E, not void.
Roel De Nijs wrote:Because the property name is not limited to alphanumeric characters, you can have properties like color1, result2, and many more
Paul Anilprem wrote:If you have a non-private method named getXxx, you have a property named xxx
The method name must have a prefix of set/get/is, followed by a letter in uppercase, [eventually] followed by an alphanumeric chain of characters.
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.
Paul Anilprem wrote:C is correct and the statement from the book is also correct. You seem to be confusing "property" with instance variable. If your method is getNumWings, then the bean is said to have a property named numWings. The fact that it does not have numWings variable and that it has numberWings variable is irrelevant.
BTW, option A is correct as well. It is valid for a getter method for a boolean property to start with the name is or get. Both are valid.
Roel De Nijs wrote:
Suresh Regmi wrote:if you look at the text book page number 206 table 4.5. It states, " 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". Then this saying is wrong.
And could you elaborate a little bit about the reason(s) why you think this statement is wrong. For me that's a true statement!