Given:



public class Canvas implements Drawable {

    public void draw() {
    }
}
public abstract class Board extends Canvas {
}
public class Paper extends Canvas {

    protected void draw(int color) {
    }
}
public class Frame extends Canvas implements Drawable {

    public void resize() {
    }
}
public interface Drawable {

    public abstract void draw();
}

Which statement is true?

A. Board does not compile.
B. Paper does not compile.
C. Frame does not compile.
D. Drawable does not compile.
E. All classes compile successfully.

題解

Paper類別編譯成功,因為Paper的draw方法和並未繼承Canvas的draw方法,簽名(signature)不同。