Олимпиадный тренинг

Задача . 27


Задача

Темы:
A certain interface  contains just a single method:
public interface SomeName
{
  int method1(Object o);
}
A programmer adds some functionality to this interface by adding another abstract method to it, method2:
public interface SomeName
{
  int method1(Object ob1);
  void method2(Object ob2);
}

As a result of this addition, which of the following is true?
(A) A ClassCastException will occur if ob1 and ob2 are not compatible.
(B) All classes that implement the original SomeName interface will need to be rewritten because they no longer implement SomeName.
(C) A class that implements the original SomeName interface will need to modify its declaration as follows:
public class ClassName implements SomeName extends method2
{ ...
(D) SomeName will need to be changed to an abstract class and provide implementation code for method2, so that the original and upgraded versions of SomeName are compatible.
(E) Any new class that implements the upgraded version of SomeName will not compile.

time 1000 ms
memory 32 Mb
Правила оформления программ и список ошибок при автоматической проверке задач

Статистика успешных решений по компиляторам
Комментарий учителя