Question: Activity (2 items x 5 points) 1. Find the statement that causes the compilation error. 2. Determine the output if that statement is removed. class

 Activity (2 items x 5 points) 1. Find the statement that

Activity (2 items x 5 points) 1. Find the statement that causes the compilation error. 2. Determine the output if that statement is removed. class A { public void test() { System.out.print("A"); } | } class B extends A { public void test() { System.out.print("B"); } } public class C extends A { public void test() { System.out.print("C"); } public static void main(String[] args) { A b1 = new A(); A b2 = new C(); b1 = (A)b2; A b3 = (B)b2; b1.test(); b2.test(); } } Property of STI IT1908 Weeks 15-16

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!