// This is called Generic Type class Pair{ public TKey Key { get; set; } public TValue Value { get; set; } public Pair(TKey key, TValue value){ Key = key; Value = value; } // This is called Generic Method public void InferredTypeArgument (T sameAsTypeParameter) { Console.WriteLine(typeof(T)); } }
No comments:
Post a Comment