下列关于Test类的定义中,正确的是( )。
A.class Test implements Runnable{ public void run{} Dublic void someMethod[]{} }
B.class Test implements Runnable( puIblic void run; }
C.class Test implements Runnable( Dublic void someMethod[]; }
D.class Test implements Runnable( public void someMethod{} }
第1题:
应在下面程序下划线中填写的正确的语句是( )。 #include <iostream> using namespace std; class A{ public: void test(){cout<< "this is A!";} }; class B:public A{ void test(){ ______ //显示调用基类函数test() cout<< "this is B!"; } }; void main(){}
A.A::test()
B.test()
C.B::test()
D.this->test()
第2题:
下列程序的运行结果是______。
include<iostream.h>
class test
{
private:
int hum;
public:
test( );
int TEST( ){return num+100;)
~test( );
};
test::test( ){num=0;)
test::~test( ){cout<<"Destructor is active"<<endl;)
void main( )
{
test x[3];
cout<<x[1].TEST( )<<endl;
}
第3题:
已知函数tEst定义为:voiDtEst() { ………… }则函数定义中voiD的含义是()
A、执行函数tEst后,函数没有返回值
B、执行函数tEst后,函数不再返回
C、执行函数tEst后,函数返回任意类型值
D、以上三个答案都是错误的
第4题:
下列关于Test类的定义中,正确的是( )。
A.
B.
C.
D.
第5题:
有如下类定义: class Test { public: Test(){a=0;c=0} //① int f(int a)const{this->a=a;} //② static int g(){return a;} //③ void h(int b){Test::b;}; //④ private: int a; static int b; const int C; }; int Test::b=0; 在标注号码的行中,能被正确编译的是( )。
A.①
B.②
C.③
D.④
第6题:
下列程序的运行结果是【 】。
include <iostream. h>
class test
{
private:
int num;
public:
test()
int TEST() {return num+100;}
~test()
};
test::test(){num=0;}
test::~test(){cout<<"Destructor is active"<<endl;}
void main()
{
test x[3]
cout<<x[1]. TEST()<<endl;
}
第7题:
如果使用Thread t=new Test()语句创建一个线程,则下列叙述正确的是
A.Test类一定要实现Runnable接口
B.Test类一定是Thread类的子类
C.Test类一定是Runnable的子类
D.Test类一定是继承Thread类并且实现Runnable接口
第8题:
如果使用 Thread t = new Test() 语句创建一个线程,则下列叙述正确的是
A)Test 类一定要实现 Runnable 接口
B)Test 类一定是 Thread 类的子类
C)Test 类一定是 Runnable 的子类
D)Test 类一定是继承 Thread 类并且实现 Runnable 接口
第9题:
有如下类定义: class Test { public: Test(){a=0;c=0;} //① int f(int a)const {this->a=a;} //② static int g(){return a;} //③ void h(int b){Test::b=b;}; //④ private: int a; static int b; const int c; }; int Test::b=0; 在标注号码的行中,能被正确编译的是
A.①
B.②
C.③
D.④
第10题:
【单选题】定义了类选择器test,让段落应用class名为test的类,下列写法正确的是:
A..test{color:red;}
B.#test{color:red;}
C.test{color:red;}
D.,test{color:red;}