Discussion Forum : Interfaces And Abstract Classes
Question - 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();
}
}
Options:
A .  will print Class One method
B .  will print Class Two method
C .  compiles fine but print nothing
D .  Compilation Error
E .  None of these
Answer: Option B

Submit Your Solution Below and Earn Points !
Next Question
Submit Your Solution hear:

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