Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 78

Given:

interface Doable {

public void doSomething (String s);

}

Which two class definitions compile? (Choose two.)

    Correct Answer: C, E

    Option A does not compile because the method implemented is doSomethingElse(String s) instead of the required doSomething(String s). Option B does not compile because doSomething(String s) is defined as abstract, but abstract methods cannot have a body. Option C compiles because it is abstract and thus not required to implement the interface method. Option D does not compile because it does not implement the required doSomething(String s) method; instead, it has doSomething(Integer i). Option E compiles because it correctly implements the required doSomething(String s) method along with other methods.

Discussion
varconiteOptions: CE

Answer is CE, Option A implements doSomethingElse(String s) instead doSomething(String s). Option C abstract method allowed not to implement functions methods

varconite

* Option C, abstract method allowed not to implement interface methods

adnano1234Options: AE

Answer is AE

MudzingwaOptions: CE

Concrete class on A does not provide implementation for doSothing(String s)

MahdiHamdiiOptions: CE

Answer is CE.

SamriddjiOptions: CE

C,E tested

Svetleto13Options: CE

C,E,tested.

shivkumarxOptions: CE

CE is correct

asdfjhfgjuaDCVOptions: CE

C and E is the correct answwer

steefaandOptions: CE

Answer C and E. A doesn't compile since method name is doSomethingElse and not doSomething. B isn't ok since doSomething is defined as abstract but provides implementation.

WilsonKKerllOptions: AE

Answer is A & E

SampsOptions: AE

A,E is the correct Option