Array of objects - modyfing object's fields C#

后端 未结 6 713
滥情空心
滥情空心 2021-01-29 06:59

I\'ve got such a problem. I\'m a beginner in C#. I have an object array (various classes) and in one place of application I want to modify fields like an age or name. Construct

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 07:18

    Object is the base class for all classes in .Net.

    Just cast the required value to the required typed class. Or Create a list with the right type instead of object.

提交回复
热议问题