June 03, 2008 Re: Classes (does this make sense?) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Saaa | Saaa wrote:
> My idea was to put everything all the fruits share in the same (abstract)
> super class.
> I would also like the assert code to be in the super class as it is the
> same for all fruits.
> Same for the color setter/getter.
>
>
Sure that's reasonable, then you can let the derived classes manipulate the color via the getter / setter interface and still make the color field private.
|
June 03, 2008 Re: Classes (does this make sense?) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lutger |
> Saaa wrote:
>
>> My idea was to put everything all the fruits share in the same (abstract)
>> super class.
>> I would also like the assert code to be in the super class as it is the
>> same for all fruits.
>> Same for the color setter/getter.
>>
>>
>
> Sure that's reasonable, then you can let the derived classes manipulate
> the
> color via the getter / setter interface and still make the color field
> private.
>
I think I'll do that then ;)
|
Copyright © 1999-2021 by the D Language Foundation