In Java:
class Base {
public Base() { System.out.println(\"Base::Base()\"); virt(); }
void virt() { System.out.println(\"Base::virt()\"); }
}
clas
Regardless of how it's implemented, it's a difference in what the language definition says should happen. Java allows you to call functions on a derived object that hasn't been fully initialized (it has been zero-initialized, but its constructor has not run). C++ doesn't allow that; until the derived class's constructor has run, there is no derived class.