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();
相关问题推荐
-
You want to limit access to a method of a public class to members of the same class. Which access modifier accomplishes this objective?()
A、 Public
B、 Private
C、 Protected
D、 Transient
E、 No access modifier is required
-
计算机感染特洛伊木马后的典型现象是(45)。
A.程序异常退出
B.有未知程序试图建立网络连接
C.邮箱被垃圾邮件填满
D.Windows系统黑屏
-
Which two methods, inserted independently at line 17, correctly complete the Sales class?()
Adouble getSalesAmount() { return 1230.45; }
Bpublic double getSalesAmount() { return 1230.45; }
Cprivate double getSalesAmount() { return 1230.45; }
Dprotected double getSalesAmount() { return 1230.45; }
-
Which two CANNOT directly cause a thread to stop executing?()
ACalling the yield method.
BCalling the wait method on an object.
CCalling the notify method on an object.
DCalling the notifyAll method on an object.
ECalling the start method on another Thread object.
-
What is the result?()
A、 X, followed by an Exception.
B、 No output, and an Exception is thrown.
C、 Compilation fails due to an error on line 14.
D、 Compilation fails due to an error on line 16.
E、 Compilation fails due to an error on line 17.
F、 X, followed by an Exception, followed by B