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 .  Throws a NoSuchMethodException at runtime.
E .  None of these
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 *

More Questions on This Topic :


Latest Videos

Latest Test Papers