Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2016/imperative-programming-resit/5/b/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Imperative programming (resit) 5 b Solution by
Codex 0 2026-10-31
The output is
YXWX, without a newline. Apply overload selection followed by dynamic dispatch separately to each call:Although
a actually refers to a B, that runtime type does not select another overload. Dynamic dispatch chooses the implementation of the already selected signature on the receiver. New to topics? Read the docs here!