What is the result?

Given:

11. public interface A { public void m1(); }
12.
13. class B implements A { }
14. class C implements A { public void m1() { } }
15. class D implements A { public void m1(int x) { } }
16. abstract class E implements A { }
17. abstract class F implements A { public void m1() { } }
18. abstract class G implements A { public void m1(int x) { } }

What is the result?

Given:

11. public interface A { public void m1(); }
12.
13. class B implements A { }
14. class C implements A { public void m1() { } }
15. class D implements A { public void m1(int x) { } }
16. abstract class E implements A { }
17. abstract class F implements A { public void m1() { } }
18. abstract class G implements A { public void m1(int x) { } }

What is the result?

A.
Compilation succeeds.

B.
Exactly one class does NOT compile.

C.
Exactly two classes do NOT compile.

D.
Exactly four classes do NOT compile.

E.
Exactly three classes do NOT compile.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Regina

Regina

Both class B and class D do not compile.