阅读背景:

如何构造两个对象,彼此作为参数/成员

来源:互联网 

I have two classes that each need an instance of each other to function. Ordinarily if an object needs another object to run, I like to pass it in the constructor. But I can't do that in this case, because one object has to be instantiated before the other, and so therefore the second object does not exist to be passed to the first object's constructor.I have two classes that each need an instance o




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: