Page 1 of 1

About Question enthuware.ocajp.i.v7.2.877 :

Posted: Mon Dec 07, 2015 11:20 am
by Russtam
I think its also need to add calculateArea() call to constructor, because after constructing instance data will left inconsistent.

Re: About Question enthuware.ocajp.i.v7.2.877 :

Posted: Mon Jan 15, 2018 7:45 am
by Hiar85
Russtam wrote:I think its also need to add calculateArea() call to constructor, because after constructing instance data will left inconsistent.
I agree

Re: About Question enthuware.ocajp.i.v7.2.877 :

Posted: Mon Jan 15, 2018 10:30 pm
by admin
That would be required if the question were asking you about the invariant i.e. area must be consistent with the length. As of now the question is only about encapsulation.
I have updated the constructor to update area as well in any case.

thank you for your feedback!
Paul.