In the book I use to prepare for the new Oracle Certified Professional - Java SE7 Programmer exam, in the section that deals with method overriding, I have come across the following:
The overriding method should have the same argument list types (or compatible types) as the base version.
What do they mean by "compatible types"? I mean, as soon as the argument list types differ, you're overloading, not overriding.
I can only think of overriding a method that takes varargs arguments, with one that takes an array of the same type. Compiler gives a warning, but compiles still.
What do they mean by compatible types? Is that an error in the book?
sub
/super
classes to the original type? – Tetrachloride(int a ,String b)
and(String b, int a)
– Kilian