我知道这听起来很混乱,但这是我能解释的最好的了。(你可以建议一个更好的标题)。我有三门课:-public class A <T extends Comparable<T>> {}public class B { // Bound mismatch: The type C is not a valid substitute for the bounded parameter <T extends Comparable<T>> of
T : class public void Write<T>() Console.Write(typeof(T).FullName);}
在上面的类中,可以为类(test<string> Test = new test<string>)传入一个字符串,然后为方法传入int?尽管经常使用泛型(在我自己的类中)和泛型集合,但我并没有真正尝试过这一点。我编写/查看泛</