Jacob wrote:
> Mark wrote:
>
>> Class Alpha is an abstract base class with package level visibiltiy
>> and a protected method: protectedMethodAlpha
>>
>> Class Gamma is a concrete class which inherits from Alpha and
>> overrides (actually defines) the protected method. It is contained
>> within the same directory as Alpha
>>
>> Class Delta is a concrete class which inherits from class Gamma and is
>> in a different package and has public visibility.
>>
>> Should class Delta be able to override protectedMethodAlpha?
>
>
> Yes.
>
> In the discussion, Alpha and Gammas relation to Alpha
> is irrelevant. For Delta the interface of Gamma is the
> only thing that matters.
>
> Gamma must be public for Delta to extend it from outside
> its package. Then Delta can override all of Gammas public
> and protected members (including protectedMethodAlpha).
>
>
For some reason when I try to create a project that illustrates this
Class Delta cannot find class Gamma, and I get an error line (red
squiggly line) under "..extends Gamma"
-Mark
|