Consider the following two class definitions.
What will the following sequence of statements print?
class X { public double g(double x) { return 3.0 * f(x); } public double f(double x) { return x; } } class Y extends X { public double f(double x) { return 5.0 * x; } }
Y y = new Y(); IO.println(y.f(2.0)); X x = y; IO.println(x.f(2.0)); IO.println(x.g(2.0));
10.0 10.0 30.0