Well in c++ a virtual function comes with a cost. To be able to provide polymorphism, overloading etc you need to declare a method as virtual.
As C++ is concerned with the layout of a program the virtual
keywords comes with an overhead which may not be desired. Java is compiled into bytecode and execute in a virtual machine. C++ and native assembly code is directly executed on the CPU. This gives you, the developer, a possibility to fully understand and control how the code looks and execute at assembler level (beside optimization, etc).
Declaring anything virtual
in a C++ class creates a vtable
entry per class on which the entire overloading thing is done.
There is also compile time polymorphism with templates that mitigates the vtable
and resolution overhead which has it's own set of issues and possibilities.