我的意思是,是否可以在不保存对所有者的引用的情况下知道Java中对象的所有者?
class Owner1 {
Owner1(){
new Child();
}
}
class Owner2{
Owner2(){
new Child();
}
}
class Child(){
Child(){
Object object = this.getOwnerObject();
if(object instanceof Owner1)
else if(object instanceof Owner2)
}
}