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

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?

    Correct Answer: E

    All classes compile successfully. The abstract class Board does not need to implement the Drawable interface's draw() method because it is abstract, and abstract classes are not required to implement interface methods. Paper compiles because it provides an overloaded draw(int color) method, which does not conflict with the draw() method inherited from Canvas. Frame compiles because it inherits the draw() method from Canvas and adds its own resize() method. The Drawable interface is correctly defined with an abstract draw() method.

Discussion
aymanjOption: E

Answer is E, TESTED. class Canvas implements Drawable { public void draw () { } } abstract class Board extends Canvas { } class Paper extends Canvas { protected void draw (int color) { } } class Frame extends Canvas implements Drawable { public void resize () { } } interface Drawable { public abstract void draw (); }

WilsonKKerllOption: E

Answer is E..

asdfjhfgjuaDCVOption: E

E is the answer

steefaandOption: E

E is correct.

r1muka5Option: E

Correct answer is E