This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread 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 ]