If there are no compile time binding in java, do this mean all binding are done at runtime?
But as per OOPs concept for runtime binding, functions must have virtual
All non-static
, non-final
and non-private
methods are virtual by default in Java. However JVM is clever enough to find classes having only one implementation of given method and turn it into static binding.
This way you don't have to remember about virtual
keyword (ever experienced memory leak due to missing virtual
on destructor in C++?) while the performance is not impacted that much.