Given:
interface Doable {
public void doSomething (String s);
}
Which two class definitions compile? (Choose two.)
Given:
interface Doable {
public void doSomething (String s);
}
Which two class definitions compile? (Choose two.)
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.
Answer is CE, Option A implements doSomethingElse(String s) instead doSomething(String s). Option C abstract method allowed not to implement functions methods
* Option C, abstract method allowed not to implement interface methods
Answer is AE
Concrete class on A does not provide implementation for doSothing(String s)
Answer is CE.
C,E tested
C,E,tested.
CE is correct
C and E is the correct answwer
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.
Answer is A & E
A,E is the correct Option