Question: Which statement is true about the following code? Select the one correct answer. (a) MyClass implements only Interface1; the implementation for void h() from Interface2
Which statement is true about the following code?

Select the one correct answer.
(a) MyClass implements only Interface1; the implementation for void h() from Interface2 is missing.
(b) The declarations of void g() in the two interfaces are in conflict, so the code will not compile.
(c) The declarations of int VAL_B in the two interfaces are in conflict, so the code will not compile.
(d) Nothing is wrong with the code; it will compile without errors.
} // File: MyClass.java abstract class MyClass implements Interfacel, Interface2 { public void f() { } public void g() { } } } interface Interfacel { int VAL A = 1; int VAL_B= 2; void f(); void g(); interface Interface2 { int VAL B = 3; int VAL_C = 4; void g(); void h();
Step by Step Solution
3.50 Rating (167 Votes )
There are 3 Steps involved in it
d The code will compile without errors The class MyClass declares that it implemen... View full answer
Get step-by-step solutions from verified subject matter experts
