abstract class A { abstract void al(); void a2() { } } class B extends A { void a1() { } void a2() { } } class C extends B { void c1() { } } and: A x = new B(); C y = new C(); A z = new C(); Which four are valid examples of polymorphic method calls?()A、 x.a2();B、 z.a2();C、 z.c1();D、 z.a1();E、 y.c1();F、 x.a1();
abstract class A { abstract void al(); void a2() { } } class B extends A { void a1() { } void a2() { } } class C extends B { void c1() { } } and: A x = new B(); C y = new C(); A z = new C(); Which four are valid examples of polymorphic method calls?()
- A、 x.a2();
- B、 z.a2();
- C、 z.c1();
- D、 z.a1();
- E、 y.c1();
- F、 x.a1();
相关考题:
下列程序片段中,能通过编译的是A.public abstract class Animal{ public void speak();}B.public abstract class Animal{ public void speak(){}}C.public class Animal{ public abstract void speak();}D.public abstract class Animal{ public abstract void speak(){}}
下列哪个类声明是正确的? ( )A.abstract final class H1 {...}B.abstract private move(){...}C.protected private numberD.public abstract class Car{...}
下列哪个类声明是正确的?A.abstract class G2 extends superClassl,superClass2{……}B.abstract public class classmates{……}C.public final class NewClass extends superClass implements Interfacel{……}D.public abstract class String{……}
Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()() A.B.C.D.E.F.
如果有-个类MyFrame是Frame的子类,但它不能被实例化,请写出该类的声明头为( )。A.abstract class Frame. extends MyFrameB.abstract class MyFrame. extends FrameC.class MyFrame. abstract extends FrameD.class Frame. abstract extends MyFrame.
Java代码查错1.abstract class Name {private String name;public abstract boolean isStupidName(String name) {}}大侠们,这有何错误?
下列对类的声明,正确的是( ) BA.abstract final class Hh{…}B.abstract private move(){…}C.protected private number;D.public abstract class Car{…}
如果有一个类MyFrame是Frame的子类,但它不能被实例化,请写出该类的声明头为( )。A.abstract class Frame. extends MyFrameB.abstract class MyFrame. extends FrameC.class MyFrame. abstract extends FrameD.class Frame. abstract extends MyFrame.
下面的代码中有什么错误吗?_______using System;class A{public virtual void F(){Console.WriteLine("A.F");}}abstract class B:A{public abstract override void F();
下列哪个类声明是正确的? ( )A.abstract class G2 extends superClass1,superClass2{...}B.abstract public class classmates{...}C.public final class NewClass extends superClass implemnets Interface1{...}D.public abstract class String{...}
下列程序片段中,能通过编译的是( )。 A.public abstract class Animal{ public void speak;}S 下列程序片段中,能通过编译的是( )。A.public abstract class Animal{ public void speak;}B.public abstract class Animal{ public void speak{);}C.public class Animal{ pubilc abstract void speak;}D.public abstract class Animal{ pubile abstract void speak{};}
下列哪个类声明是正确的? ( )A.abstract class G2 extends superClass1, superClass2 {…}B.abstract public class classmates{…}C.public final class NewClass extends superClass implemnets Interfacel{…}D.public abstract class String{…}
Which declaration prevents creating a subclass of an outer class?()A、 Static class FooBar{}B、 Private class FooBar{}C、 Abstract public class FooBar{}D、 Final public class FooBar{}E、 Final abstract class FooBar{}
下列哪个类的声明是正确的()A、abstract final class HI{}B、abstract private move(){}C、protected private number;D、public abstract class Car{}
下列哪个类声明是正确的()。A、abstract final class H1{…}B、abstract private move(){…}C、protected private number;D、public abstract class Car{…}
下列是抽象类的声明的是()A、 abstract class figure{ }B、 class abstract figure{ }C、 seald class figure{ }D、 static class figure{ }
单选题Which declaration prevents creating a subclass of an outer class?()A Static class FooBar{}B Private class FooBar{}C Abstract public class FooBar{}D Final public class FooBar{}E Final abstract class FooBar{}
多选题public abstract class Shape { private int x; private int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } Which two classes use the Shape class correctly?()Apublic class Circle implements Shape { private int radius; }Bpublic abstract class Circle extends Shape { private int radius; }Cpublic class Circle extends Shape { private int radius; public void draw(); }Dpublic abstract class Circle implements Shape { private int radius; public void draw(); }Epublic class Circle extends Shape { private int radius;public void draw() {/* code here */} }Fpublic abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }
单选题现有: 1. interface Animal { 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat extends Feline { 8. public void eat() { } 9. } 和五个声明: abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat(); } abstract class Feline implements Animal { public void eat(); } abstract class Feline implements Animal { public void eat() { } } abstract class Feline implements Animal { abstract public void eat(); } 分别插入到第5行,有几个可以通过编译?()A0B1C2D3
单选题现有: interface Animal { void eat () ; } //insert code here public class HouseCat extends Feline { public void eat() { } } 和五个申明 abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat () ; } abstract class Feline implements Animal { public void eat();} abstract class Feline implements Animal { public void eat() {} } abstract class Feline implements Animal { abstract public void eat();} 结果为:()A1B2C3D4
单选题下列是抽象类的声明的是()A abstract class figure{ }B class abstract figure{ }C seald class figure{ }D static class figure{ }