多项选择题
下列有关抽象方法叙述正确的是哪项?()
A. 抽象方法和普通方法一样,只是前面多加一个修饰符asbtract
B.抽象方法没有方法体
C.抽象方法可以包含存任何类中
D.包含抽象方法的类的具体子类必须提供具体的覆盖方法
点击查看答案&解析
相关考题
-
单项选择题
下列有关抽象类的叙述正确的是哪项?()
A.抽象类中一定含有抽象方法
B.抽象类的声明必须包含abstract关键字
C.抽象类既能被实例化也能被继承
D.抽象类中不能有构造方法 -
多项选择题
现有: class HorseRadish { //insert code here protected HorseRadish (int x) { System.out.println ("bok choy"); } } class Wasabi extends HorseRadish { public static void main (String [] args){ Wasabi w- new Wasabi(); } } 分别插入到第2行,哪两项允许代码编译并产生”bok choy”输出结果()
A. protected HorseRadish() {this (42);}
B. protected HorseRadish() {}
C. //just a comment
D. protected HorseRadish() { new HorseRadish (42);} -
单项选择题
现有: 1.class SuperFoo{ 2.SuperFoo doStuff (int x) { 3.return new SuperFoo(); 4. } 5. } 6. 7. class Foo extends SuperFoo { 8. //insert code here 9. } 和四个声明: Foo doStuff (int x) { return new Foo(); } Foo doStuff (int x) { return new SuperFoo(); } SuperFoo doStuff(int x) { return new Foo(); } SuperFoo doStuff(int y) { return new SuperFoo(); } 分别插入到第8行,有几个可以通过编泽?()
A. 1
B. 2
C. 3
D. 4
