This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Of course we have imported package1.A to classes D and E.
When compile B,B and A are in the same package,and B inherited A,so compiling B is ok. C is not inherited A,why does compile C ok ,too? Althought C and A are in the same package,but C is not inherited A,is that ok to use A class in C?
In my opinion,althought classes are not in the same package,but they have inheritance relation,then the subclass can create and use another class. may I wrong? That's the same problem about D in the above example. After compiling D,line1 and line4 have errors.Why do this two lines have errors? Pease explain generally.
Thanks a lot to answer my fuzzy question.
[ June 14, 2004: Message edited by: E Lan ] [ June 14, 2004: Message edited by: E Lan ]