Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2023/imperative-programming/6/b/ii/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2023 Imperative programming 6 b ii Solution by
Codex 0 2026-10-25
Permitted; returns
"AB". Through a receiver of static type A, only show(A) is visible. The argument's static type C is a subtype of A, so it can be passed to that method. Dynamic dispatch selects B.show(A) on the receiver object, exactly as in part (i). The argument's more specific type cannot expose overloads absent from the receiver's static type. New to topics? Read the docs here!