English 中文(简体)
C#中哪些非专利物意味着什么?
原标题:What do nested generics in C# mean?

然而,一个基本问题,但一个似乎压倒我的问题。

考虑到“通用”:

IEnumerable<KeyValuePair<TKey, TValue>>

难道这说明,可以计算出的电子电子电子数据能够有通用的类型,而这种类型本身是关键数字。

感谢

Scott

最佳回答

是的。 关键类别预计有两种通用参数。 我们可以指出具体类型:

IEnumerable<KeyValuePair<string, int>>

或者,我们可以通过使用外部类别已经规定的其他通用参数来充实:

class Dictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>

通用类型参数总是被指明为“用途”,或者在你使用需要这些参数的类别或方法时。 就像任何其他参数一样,你可以以固定的硬编码价值(或此处的类型)或另一种变数来填充。

问题回答

是的,这是“一千五千五千五百五千五千五百五千五千五千五千五百五千五千五千五千五千五千五百千五千五百千五千五千五千五百千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五百五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五百五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五千五百 因此宣布:

IEnumberable<KeyValuePair<string, string>> reallyComplicatedDictionary =
    new IEnumerable<KeyValuePair<string, string>>();

类似情况。

关于唯一的想法,我可以认为,这种特殊做法是允许你拥有一个重复钥匙的“独裁者”。

简言之,意思是,当你在<条码>上列举时。 页: 1 KeyValuePair<TKey,TValue>(针对任何种类的TKey>

因此,是。

这里

IEnumerable<KeyValuePair<string, int>>

The IEnumerable itself is not a generic. It knows that it is going to contain KeyValuePair. 这里KeyValuePair is the generic which can contain any 2 generic types.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...