There are two packages, P1 and P2. P1 has class A which extends Q. Q is in another package. P2 has class B whose access modifier is default, i.e. class can be accessed only in its package. B also extends class Q.
Now, class A wants to use (access) implementation of a method which is in class B.
Please suggest a solution. May be it could involve interface and abstract classes.
Thanks! Bye, Viki
[ November 11, 2008: Message edited by: Vikrama Sanjeeva ] [ November 12, 2008: Message edited by: Vikrama Sanjeeva ]
I think you may create a public/protected class inside class B's package that extends class B, say we call it class C. Then, have class A extend class C to be able to get the implementations in class B, at the same time class A can still use the implementations from class Q since class B extends class Q. To illustrate:
from this scenario: class B extends Q public class A extends Q
to this scenario: public class B extends Q public class C extends B public class A extends C
just my 2 cents, im mobile right now and dont have the time to test it myself. hope that helps.