Skip to content

Comment on Hacking a Google Interview - MIT's guide to Google interviewsparent

Comments

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.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.