How do I access an anonymous object's properties outside its scope?

前端 未结 4 974
终归单人心
终归单人心 2021-01-25 19:08

Scope might not be the right word. With the following code I can\'t get access to the collections element\'s object\'s properties. Is there a better return data type or a way t

4条回答
  •  面向向阳花
    2021-01-25 20:01

    I would recommend simply creating a new type for passing the data. If the scope of the data is protected, you can used a protected nested subclass to prevent over-proliferation of small data classes.

提交回复
热议问题