Which two classes use the Shape class correctly?

Given:

11. public abstract class Shape {
12. private int x;
13. private int y;
14. public abstract void draw();
15. public void setAnchor(int x, int y) {
16. this.x = x;
17. this.y = y;
18. }
19. }

Which two classes use the Shape class correctly? (Choose two.)

Given:

11. public abstract class Shape {
12. private int x;
13. private int y;
14. public abstract void draw();
15. public void setAnchor(int x, int y) {
16. this.x = x;
17. this.y = y;
18. }
19. }

Which two classes use the Shape class correctly? (Choose two.)

A.
public class Circle implements Shape {
private int radius;
}

B.
public abstract class Circle extends Shape {
private int radius;
}

C.
public class Circle extends Shape {
private int radius;
public void draw();
}

D.
public abstract class Circle implements Shape {
private int radius;
public void draw();
}

E.
public class Circle extends Shape {
private int radius;
public void draw() {/* code here */}

F.
public abstract class Circle implements Shape {
private int radius;
public void draw() { /* code here */ }



Leave a Reply 0

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