Can I Create a Dictionary of Generic Types?

前端 未结 10 2432
误落风尘
误落风尘 2020-11-30 02:53

I\'d like to create a Dictionary object, with string Keys, holding values which are of a generic type. I imagine that it would look something like this:

Dict         


        
10条回答
  •  一向
    一向 (楼主)
    2020-11-30 03:21

    How about Dictionary? (assuming you're on C# 4)

    Dictionary Dict = new Dictionary();
    

    Source: https://stackoverflow.com/a/5038029/3270733

提交回复
热议问题