Witam przeglądam sobie przykładowe zadania z zestawu testów na OCPJP i trafiłem na takie zadanie:
Given:
public interface Word {boolean isSpelled(String w); }
And three files:
1. abstract class Verb1 implements Word{boolean isSpelled(){}}
2. abstract class Verb2 implements Word{boolean isSpelled(){return true;}}
3. abstract class Verb3 implements Word{boolean isSpelled(String w){return true;}}
Which is true:
A. Only the first file will compile
B. Only the first and second files will compile.
C. Only the first and third will compile.
D. Only the second file will compile.
E. All three files will compile.
W odpowiedziach mam odpowiedź, że D (tylko 2) się skompiluje, jednak wydaje mi się, że dobra odpowiedź to taka w której 2 i 3 się skompilują