If dostuff is the usual method, you need to pass the Bar instance.
class Owner { Bar b = new Bar(this); dostuff(){...} } class Bar { Bar(Owner owner) { owner.dostuff(); } }
Please note that there can be many owners in Bar, not some realistic way of knowing who they are.
Edit: You may be looking for the Inner class: Sample and comments.
class Owner { InnerBar b = new InnerBar(); void dostuff(){...} void doStuffToInnerBar(){ b.doInnerBarStuf(); }
source share