C#: Declaring and using a list of generic classes with different types, how?

后端 未结 9 1506
猫巷女王i
猫巷女王i 2020-12-23 21:19

Having the following generic class that would contain either string, int, float, long as the type:

public class MyData         


        
9条回答
  •  无人及你
    2020-12-23 21:49

    In that case you need MyData since that is the only thing those types have in common.

    提交回复
    热议问题