Which two class definitions compile?

Given:
interface Doable {
public void doSomething (String s);
}
Which two class definitions compile?

Given:
interface Doable {
public void doSomething (String s);
}
Which two class definitions compile?

A.
public abstract class Task implements Doable {
public void doSomethingElse(String s) { }
}

B.
public abstract class Work implements Doable {
public abstract void doSomething(String s) { }
public void doYourThing(Boolean b) { }
}

C.
public class Job implements Doable {
public void doSomething(Integer i) { }
}

D.
public class Action implements Doable {
public void doSomething(Integer i) { }
public String doThis(Integer j) { }
}

E.
public class Do implements Doable {
public void doSomething(Integer i) { }
public void doSomething(String s) { }
public void doThat (String s) { }
}



Leave a Reply 4

Your email address will not be published. Required fields are marked *


CompileTester

CompileTester

A, E

Berti John

Berti John

A, E is correct