New answers tagged


The important sentence in the first quote is In case of overriding, if a method with the same name is declared in the superclass then it must have the same type. So if you have class C1 { ... } class C2 { ... } class Cls { C1 foo(C2 x) { ... } } override(foo, Cls, (C2)->C1) holds but override(foo, Cls, (C2)->C2) doesn't; the subclass class ...

Top 50 recent answers are included