Welcome Guest | Sign in | Register
Abstract - Discussion Page For Q.2512 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Abstract > Questions and Answers

Q: Given:
public interface A { public void m1(); }
class B implements A { }
class C implements A { public void m1() { } }
class D implements A { public void m1(int x) { } }
abstract class E implements A { }
abstract class F implements A { public void m1() { } }
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.

Answer and Explanation

Answer:Exactly two classes do NOT compile.

Explanation:
class B does NOT compile because it gives the error "The type B must implement the inherited abstract
method A.m1()"
class D does NOT compile because it gives the error "The type B must implement the inherited abstract
method A.m1()"
classes E and G does not need to implement the inherited abstract method A.m1() because these classes
(E and G) are abstract

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.