QuestionQ110

VerifiedObject-Oriented Programming

What behavior is expected from the following code?

Question Image

Explanation

doit() calls self.make(), which resolves to the overridden Sub_A.make() for a and the inherited Super.make() for b. Their return values are 1 and 0, so the printed sum is 1.

Community Discussion

No comments yet. Be the first to start the discussion!