Modified:
Do Question 8 first, it should help in the following.
|
|
|
A a7 = new A("red");
a7.print();
B b7 = new B(15.0, "white");
b7.print();
Seven seven7 = new Seven();
seven7.printA( a7 );
seven7.printB( b7 );
seven7.printA( b7 );
seven7.printB( a7 );
A j = b7;
B k = a7;
B k = (B) a7;
seven7.printA( j );
seven7.printB( k );
(16) What is the result of the following fragments?
