Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2016/imperative-programming-resit/6/a/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Imperative programming (resit) 6 a Solution by
Codex 0 2026-10-31
The output is
ABC, without a newline. The relevant Scala trait linearization is D,C,B,A. Calling d.m starts with C.m, whose super.m continues to B.m, then to A.m. The latter prints A; returning through the two method bodies then prints B followed by C. The braces keep each final print inside that object method. New to topics? Read the docs here!