Question: What is the output of this code? interface A{ void firstMethod(): void secondMethod(); } class B implements A{ void firstMethod() { System.out.print(first); } } class

 What is the output of this code? interface A{ void firstMethod():

What is the output of this code? interface A{ void firstMethod(): void secondMethod(); } class B implements A{ void firstMethod() { System.out.print("first"); } } class C extends A{ void secondMethod() { System.out.print("second"); } } Bb = new BO: A a = new CO; a secondMethodo: b.firstMethod(); first second second first O Runtime Error Compilation Error

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!