Given: 11. public abstract class Shape { 12. int x; 13. 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. } and a class Circle that extends and fully implements the Shape class. Which is correct?

  1. Shape s = new Shape(); s.setAnchor(10,10); s.draw();

  2. Circle c = new Shape(); c.setAnchor(10,10); c.draw();

  3. Shape s = new Circle(); s.setAnchor(10,10); s.draw();

  4. Shape s = new Circle(); s->setAnchor(10,10); s->draw();


Correct Option: C

Find more quizzes: