A: class A { abstract void unfinished() { } }
B: class A { abstract void unfinished(); }
C: abstract class A { abstract void unfinished(); }
D: public class abstract A { abstract void unfinished(); }
举一反三
- 下面的类定义中,哪个定义了合法的抽象类()。 A: abstract class A{ abstract void unfinished(){}} B: class B{ void unfinished() {};} C: abstract class C{ abstract void unfinished();} D: abstract class D{ protected void unfinished();}
- 下面关于抽象类定义合法的是( ) 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(); }
- 下列类定义中哪些是合法的抽象类的定义? 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: 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();}
内容
- 0
下列类的定义中哪些是合法的抽象类?( ) A: sealed abstract class c1{abstract public void test() {} B: abstract sealed public viud test(); C: abstract class c1 { abstract void test(); //test()默认为私有,不合法 D: abstract class c1 {abstract public void test(); }
- 1
下列关于抽象类定义,正确的是( ) 。 A: abstract AbstractClass{ abstract void method();} B: class abstract AbstractClass{ abstract void method();} C: abstract class AbstractClass{ abstract void method();} D: abstract class AbstractClass{ abstract void method(){ System.out.println(“method”); }}
- 2
下列类定义中属于合法的抽象类的定义的是() 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")};}
- 3
接口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!");)}; }
- 4
若有如下类A的定义,下列哪些类正确继承了该类: abstract class A { abstract void method1(int i); abstract void method2(int j); } A: abstract class B extends A{ void method1( ) { } void method2( ) { } } B: class B { void method1(int i ) { } void method2(int j ) { } } C: class B implements A { void method1(int i ) { } void method2(int j ) { } } D: class B extends A{ public void method1(int x ) { } public void method2(int y ) { } }