Storing different types inside a list?

后端 未结 6 1040
广开言路
广开言路 2021-02-19 03:34

Related: A list of multiple data types?

I want to know how to store different array types (including system types) inside an array.

The above question covered ho

6条回答
  •  星月不相逢
    2021-02-19 03:55

    You can specify not only custom types. List, List, List will works as well. If you need to store mixed types - you need to specify closest base class for all types. In List can be stored instance of any type.

    提交回复
    热议问题