假定类A已经定义,对于以A为基类的单一继承类B,以下定义中正确的是:( )
A: class B:public A{//...};
B: class A:public B{//...};
C: class B:public class A{//...};
D: class A:class B public{//...};
A: class B:public A{//...};
B: class A:public B{//...};
C: class B:public class A{//...};
D: class A:class B public{//...};
举一反三
- 定义虚基类的说明中,正确的格式是( ) A: virtual class B:public A B: class virtual B:public A C: class B:virtual public A D: class B:public A virtual
- Object 类中定义了以下( )方法,此方法将被所有子类继承。 A: public static Class getClass() B: public final Class getClass() C: public final Class getName() D: public Class getName()
- 下列虚基类的声明中,正确的是________。 A: class B:public A B: class B:virtual public A C: virtual class B:public A D: class virtual B:public A
- 下列虚基类的声明中正确的是( )。 A: class virtual B:public A B: virtual class B:public C: class B:public A virtual D: class B: virtual public A
- 下列哪些是合法的类定义语句 A: public class A {} B: class A extends Exception,I0Exception {} C: public class 1A extends Object D: public class String {}