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

Given:

1. public abstract class Shape {
2. private int x;
3. private int y;
4. public abstract void draw();
5. public void setAnchor(int x, int y) {
6. this.x = x;
7. this.y = y;
8. }
9. }

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

Given:

1. public abstract class Shape {
2. private int x;
3. private int y;
4. public abstract void draw();
5. public void setAnchor(int x, int y) {
6. this.x = x;
7. this.y = y;
8. }
9. }

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 *