Sail E0 Webinar
Question
What will be the output?interface A{public void method1();}class One implements A{public void method1(){System.out.println("Class One method1");}}class Two extends One{public void method1(){System.out.println("Class Two method1");}}public class Test extends Two{public static void main(String[] args){A a = new Two();a.method1();}}
Options:
A .  Compilation Error
B .  Class One method1
C .  Class Two method1
D .  Nothing will be printed
Answer: Option C

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers