欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

public abstract class Shape { 
int x; 
int y; 
public abstract void draw(); 
public void setAnchor(int x, int y) { 
this.x = x; 
this.y = y; 
} 
} 
and a class Circle that extends and fully implements the Shape class. Which is correct?() 

    A. Shape s = new Shape(); s.setAnchor(10,10); s.draw();
    B. Circle c = new Shape(); c.setAnchor(10,10); c.draw();
    C. Shape s = new Circle(); s.setAnchor(10,10); s.draw();
    D. Shape s = new Circle(); s->setAnchor(10,10); s->draw();
    E. Circle c = new Circle(); c.Shape.setAnchor(10,10); c.Shape.draw();

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题