K
Ken K
I have the following situation:
Class A implements AI
Class B has a method public AI x();
I want to extend A (or implement an extension of AI) to get Class C
with a constructor such that the instantiation constructed equals (new
B()).x().
This won't be circular, as B does not use this constructor to get its
A.
I've done something close by creating Class C {
private AI a;
C {a = new B().x();}
public A getA () {return a;}
}
I was looking for a solution that doesn't require the psuedoproperty
getA. I could also make a public and do new C().a. Still not quite
(A)(new C()).
Any ideas how I can make this work?
Ken
Class A implements AI
Class B has a method public AI x();
I want to extend A (or implement an extension of AI) to get Class C
with a constructor such that the instantiation constructed equals (new
B()).x().
This won't be circular, as B does not use this constructor to get its
A.
I've done something close by creating Class C {
private AI a;
C {a = new B().x();}
public A getA () {return a;}
}
I was looking for a solution that doesn't require the psuedoproperty
getA. I could also make a public and do new C().a. Still not quite
(A)(new C()).
Any ideas how I can make this work?
Ken