3 ms·
Any definition of polymorphism should at least mention something about the method that is invoked depends on runtime data, and is not resolved (or known) at com
by jonsen 17y ago
Any definition of polymorphism should at least mention something about the method that is invoked depends on runtime data, and is not resolved (or known) at compile time.
Yes
class A { ... f() ... }
class B extends A { ... f() ... }
class C extends A { ... f() ... }
A x = ... // a B object or a C object
x.f()
is polymorphism if anything.