Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2023/imperative-programming/6/b/iv/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2023 Imperative programming 6 b iv Solution by
Codex 0 2026-10-25
Permitted; returns
"BC". Through static type B, both show(A) and show(B) accept an argument of type C; method overloading selects the more specific show(B). The receiver's runtime type is C, so dynamic dispatch invokes C.show(B). Its super.show(o) calls B.show(B), returning "B", and the override appends "C". The show(C) overload is not visible through receiver type B. New to topics? Read the docs here!