单项选择题
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();
单项选择题 1. interface TestA { String toString(); } 2. public class Test { 3. public static void main(String[] args) { 4. System.out.println(new TestA() { 5. public String toString() { return “test”; } 6. } 7. } 8. } What is the result?()
单项选择题 class TestA { public void start() { System.out.println(”TestA”); } } public class TestB extends TestA { public void start() { System.out.println(”TestB”); } public static void main(String[] args) { ((TestA)new TestB()).start(); } } What is the result?()
单项选择题 public interface A { String DEFAULT_GREETING = “Hello World”; public void method1(); } A programmer wants to create an interface called B that has A as its parent. Which interface declaration is correct?()