Hacker News new | ask | show | jobs
by ysleepy 3351 days ago
Java only has single dynamic dispatch. That means it will use the method of the most specific sub-class, but will not dispatch on the runtime type of the argument, only its compile time type.

So something like:

  for(None n: expreTree.children()) {
    intMath.eval(n);
  }
will not work as expected if eval is overloaded.