> package XX;
> class A
[quoted text clipped - 18 lines]
> }
> }
_________
Because protected keyword gives access to subclasses and other members of
the same package.
And class C is not a subclass and not in package XX.
> but if we modify as below:
> package YY;
[quoted text clipped - 10 lines]
> why above modify can success?
> 3ks
Because B is a subclass of A
Lew - 26 Jan 2008 17:18 GMT
<junzhang1983@gmail.com> wrote ...
>> package XX;
>> class A
[quoted text clipped - 18 lines]
>> }
>> }
This will not compile. Why does the comment refer to B.kk()? Class B is not
involved in the C invocation at all. C does not have a method kk().

Signature
Lew
>why above modify can success?
two things. Please use standard caps conventions when you write code,
especially lower case package names. See
http://mindprod.com/jgloss/codingconventions.html
It makes your code look extremely weird to an eye accustomed to
conformant code.
Next read up on what the various scopes are supposed to do.
See http://mindprod.com/jgloss/scope.html
http://mindprod.com/jgloss/protected.html

Signature
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com