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();}
内容
- 0
下列抽象类的定义合法的是( )。 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”);}}
- 1
下面关于抽象类定义合法的是( ) 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(); }
- 2
下列类定义中()是合法的抽象类的定义。 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();}
- 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 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”); }}