What is the expected result of the following code?
Instance method calls use dynamic dispatch: a.doit() invokes Sub_A.make() and returns 1, while b.doit() invokes Sub_B.make() and returns 2. The printed sum is 3.
a.doit()
Sub_A.make()
b.doit()
Sub_B.make()
Community Discussion