What are the rules to implement an interface? Considering the following declaration for interface Convertable, which of the following code segments will compile?
public interface Convertable {
int convertToInt();
char convertToChar();
}
a)
class Digit implements Convertable {
public char convertToChar() {
return 0;
}
public int convertToInt() {
return 0;
}
}
b)
abstract class Digit implements Convertable {
int convertToInt();
char convertToChar();
}
c)
abstract class Digit implements Convertable {
public int convertToInt() {
return 0;
}
}
d)
abstract class Digit implements Convertable {
public int convertToInt() {
return 0;
}
char convertToChar();
}
e)
class Digit implements Convertable {
int convertToInt() {
return 0;
return 0;
}
}
f)
interface Roundable extends Convertable {
int roundUp();
}