下面的类定义中,哪个定义了合法的抽象类()。
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: 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 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 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(); }
- 下列类定义中()是合法的抽象类的定义。 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 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”);}}