Question: Consider a class hierarchy Object, Shape, Circle in a fictitious programming language Lang401 (syntax borrowed from Java) class Object class Shape extends Object Shape translate(Shape

Consider a class hierarchy Object, Shape, Circle in a fictitious programming language Lang401 (syntax borrowed from Java) class Object class Shape extends Object Shape translate(Shape arg) [.3 class Circle extends Shape // override translate from Shape SomeType translate(SomeOtherType arg) [ The Lang401 designers would like to give programmers maximum flexibility What function signatures could they allow for Circle.translate that would be a type-safe overrider of Shape.translate? Shape translate(Shape arg) O Object translate(Shape arg) O Circle translate(Shape arg) Shape translate(Object arg) O Shape translate(Circle arg) O Object translate(Object arg) Circle translate(Circle arg) O Object translate(Circle arg) O Circle translate(Object arg)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
