Originally posted by Carol Enderlin:
protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature.
You must be thinking of default, available only to classes in same package.i think when a subclass inherits protected members from the base class it becomes private to the subclass and no code outside the subclass can access it .
but in this case class (Two) is inheriting the protected members of the base class (One) . so the protected members of the base class(One)becomes private members to this subclass(Two). now any class which extends this subclass (Two) can't access this protected members.but it is possible
i dont know why it is ?
i think when a subclass inherits protected members from the base class it becomes private to the subclass and no code outside the subclass can access it .
SCJP, SCWCD
Originally posted by Edwin Keeton:
Ajay Xavier wrote:
Originally posted by Edwin Keeton:
Thanks for your explanation
i got it now