下列类定义中属于合法的抽象类的定义的是()
A: A.abstract Animal{abstract void growl()}
B: B.class abstract Animal{abstract void growl()}
C: C.abstract class Animal{abstract void growl()}
D: D.abstract class Animal{ abstract void growl(){System.out.println("growl")};}
A: A.abstract Animal{abstract void growl()}
B: B.class abstract Animal{abstract void growl()}
C: C.abstract class Animal{abstract void growl()}
D: D.abstract class Animal{ abstract void growl(){System.out.println("growl")};}
举一反三
- 下列抽象类的定义合法的是( )。 A: abstract Animal {abstract void growl();} B: abstract class Animal {abstract void growl();} C: class abstract Animal {abstract void growl();} D: abstract class Animal {abstract void growl() {System.out.println(“growl”);}}
- 下列类定义中()是合法的抽象类的定义。 A: abstract<br/>Animal {abstract void growl();} B: abstract<br/>class Animal {<br/>abstract<br/>void growl() { System.out.println(“growl”);}<br/>} C: class<br/>abstract Animal {abstract void growl();} D: abstract<br/>class Animal {abstract void growl();}
- 下列类定义中哪些是合法的抽象类的定义? A: abstract Animal{abstract void grow();} B: class abstract Animal{abstract void growl();} C: abstract class Animal{abstract void growl();} D: abstract class Animal{abstract void grow(){System.out.println("growl")};
- 下面关于抽象类定义合法的是( ) A: class Animal { abstract void grow(); } B: abstract Animal { abstract void grow(); } C: class abstract Animal { abstract void grow(); } D: abstract class Animal { abstract void grow(); }
- 接口Animal声明如下:public interface Animal{ void Move();}则下列抽象类的定义中, 是合法的。 A: abstract class Cat: Animal { abstract public void Move(); } B: abstract class Cat: Animal { virtual public void Move(){Console.Write(Console.Write("Move!");)} } C: abstract class Cat: Animal { public void Move(){Console.Write(Console.Write("Move!");)}; } D: abstract class Cat: Animal { public void Eat(){Console.Write(Console.Write("Eat!");)}; }