我有一个简单的世袭结构,Base和Derived有其通常的含义。call(b2); void call(Derived2 d){}
} 为什么java不允许我调用不同类型的call方法?method call(Derived1) in the type Test is not applicable for the arguments (Base) 难道它不能在运行时找出类型并调用适当的方法吗
考虑这两个抽象类。MyClass2扩展了我的BaseClass并覆盖了一个虚方法。注意,它还将MyBaseClass的TValue定义为IList...{
public virtual抱怨的是MyClass2.DoSomeStuff的返回类型。错误是“重写方法”IList<TValue> MyClass2<TKey, TValue>