What will happen for the following statements in Java:
SuperclassObject o = new SubclassObject();
then we run
o.randomMethod();
However, randomMethod()
has been implemented in both SuperclassObject
and SubclassObject
, but in different ways. Which method will be called??