About Question com.enthuware.scja.v1.2.11 :
Posted: Fri Jul 12, 2013 12:41 pm
Hello and thank you for your support!
i'd like to discuss about this question, that i don't understand fully (although i've answered right..
).
the question is:
A JavaBean has a property named size, which is accessible to and modifiable by all other classes. Which of the following statements are correct regarding this class?
one of the wrong answer was:
the class must have an instance variable named size.
and the explanation given is:
While quite intuitive and common, this is not a necessity. The getter and setter methods may have some computational logic that does not involve any instances variable or may involve multiple instance variables. If a JavaBean has a getX and setX method, it is said to have a property x, irrespective of whether it has an instance variable x or not.
i don't understand...
shouldn't there be a variable named size to have the setter and getter setSize and getSize?
otherwise the setter and getter would get different names, i guess... so kindly, can you help me?
best regards
i'd like to discuss about this question, that i don't understand fully (although i've answered right..

the question is:
A JavaBean has a property named size, which is accessible to and modifiable by all other classes. Which of the following statements are correct regarding this class?
one of the wrong answer was:
the class must have an instance variable named size.
and the explanation given is:
While quite intuitive and common, this is not a necessity. The getter and setter methods may have some computational logic that does not involve any instances variable or may involve multiple instance variables. If a JavaBean has a getX and setX method, it is said to have a property x, irrespective of whether it has an instance variable x or not.
i don't understand...

otherwise the setter and getter would get different names, i guess... so kindly, can you help me?
best regards