下列类的定义中哪些是合法的抽象类?( )
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(); }
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(); }
举一反三
- 下面类的定义,哪个是合法的抽象类定义? 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和抽象类Test的定义如下: abstract class A { abstract int getInfo() { } } public class Test extends A { private int a = 0; public int getInfo() { return a; } public static void main(String args[]) { Test b= new Test(); System.out.println(b.getInfo()); } } 关于上述代码说明正确的是_________
- 下列类定义中哪些是合法的抽象类的定义? 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")};
- 判断C#类MyClass的定义中哪些定义是合法的抽象类 A: abstract class Myclass{ abstract int getCount();} B: private abstract class Myclass{ abstract int getCount();} C: abstract class Myclass{ public abstract int getCount();} D: sealed abstract class Myclass{ abstract int getCount();}
- 下面的类定义中,哪个定义了合法的抽象类()。 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();}