首先,记住一个.NET String是IConvertible和ICloneable 。 现在,考虑以下相当简单的代码: //contravariance "in" interface ICanEat<in T> where T : class { void Eat(T food); } class HungryWolf : ICanEat<ICloneable>, ICanEat<IConvertible> { public void Eat(IConvertible convertibleFood) { Console.WriteLine("This wolf ate your CONVERTIBLE object!"); } public void Eat(ICloneable cloneableFood) { Console.WriteLine("This wolf ate your CLONEABLE object!"); } } 然后尝试以下(在一些方法中): ICanEat<string> wolf = new HungryWolf(); […]