How to reference parent in inline creation of objects?

前端 未结 3 755
清歌不尽
清歌不尽 2021-01-20 13:54

Let\'s say I have a parent/child-relationship ob objects and try to create a parent object inline (I\'m not really sure that\'s the right word). Is it possible to reference

3条回答
  •  生来不讨喜
    2021-01-20 14:41

    No, because the reference starts referencing the allocated object after the constructor's execution has finished.

提交回复
热议问题