What is the result?
interface A{ void x();}
class B implements A{
public void x(){}
public void y(){}
}
class C extends B{
public void x(){}
}
class Teste{
public static void main(String[] args) {
java.util.List<A> list = new java.util.ArrayList<A>();
list.add(new B());
list.add(new C());
for (A a : list) {
a.x();
a.y(); //erro.
}
}
}
Options:
A) The code runs with no output.
B) An exception is thrown at runtime.
C) Compilation fais because of an error in line 20.
D) Compilation fais because of an error in line 21.
E) Compilation fais because of an error in line 23.
F) Compilation fais because of an error in line 25.
Alguem poderia me ajudar com essa questão?
