Vidyalelo
Java Programming · Q40

Interfaces and Abstract Classes

Programming · Java Programming · question 40

Q40

What will be the output? interface A public void method(); class One public void method() System.out.println("Class One method"); class Two extends One implements A public void method() System.out.println("Class Two method"); public class Test extends Two public static void main(String[] args) A a = new Two(); a.method();

A.
will print Class One method
B.
will print Class Two method
Answer
C.
compiles fine but print nothing
D.
Compilation Error
E.
None of these

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board