[单选题]

下列关于Test类的定义中,正确的是______。

A.) class Test implements Runnabte{

public void run(){}

public void someMethod(){}

B.) class Test implements Rnuuable{

public void run();

}

C.) class Test implements Rnuuable{

public void someMethod();

}

D.) class Test implements Rnuuable{

public void someMethod();{}

}

A.

B.

C.

D.

参考答案与解析:

相关试题

有如下类定义:class Test{public:Test(){ a = 0;

[单选题]有如下类定义:class Test{public:Test(){ a = 0; c = 0;} // ①int f(int a)const{this->a = a;} // ②static int g(){return a;} // ③void h(intB. . {Test::b = b;}; // ④private:int a;static int b;const int c;};int Test::b = 0;在标注号码的行中,能被正确编译的是A. . ①B. . ②C. . ③D.

  • 查看答案
  • 有如下类定义: class Test { public: Test(){a=0;

    [单选题]有如下类定义: 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.④

  • 查看答案
  • 下列关于Test类的定义中,正确的是(  )。

    [单选题]下列关于Test类的定义中,正确的是(  )。A.B.C.D.

  • 查看答案
  • 下列关于Test类的定义中,正确的是(  )。

    [单选题]下列关于Test类的定义中,正确的是(  )。A.B.C.D.

  • 查看答案
  • 有如下类定义:class Test {public: Test(){a=0;C=

    [单选题]有如下类定义: class Test { public: Test(){a=0;C=0;t //① 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.④

  • 查看答案
  • 有如下类定义:class Test{public:Test(){a=0;c=0}

    [单选题]有如下类定义: 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.④

  • 查看答案
  • 有如下类定义:class Test{int x_,y_;public:Test

    [单选题]有如下类定义: class Test { int x_,y_; public: Test ():a_(0) ,b_(0) {} Test(int a,int b=0) :a_(a),b_(b){} }; 若执行语句 Test x(2) ,y[3],*z[4]; 则Test类的构造函数被调用的次数是( )。A.2次B.3次C.4次D.5次

  • 查看答案
  • 如下代码定义了一个类Test:class Test {private int y

    [单选题]如下代码定义了一个类Test: class Test { private int y; Test (int x) { y:x; } }现在为Test 类生成一个对象,正确的语句是( )。A.Test t = new Test( );B.Test t=new Test(10, 20);C.Test t;D.Test t=new Test(10);

  • 查看答案
  • 下列程序test类中的变量e的最后结果为()。public class test

    [单选题]下列程序test类中的变量e的最后结果为( )。 public class test { public static void main (String args[]) { int a=10; int b; int c; if(a>50) { b=9; } c=b+a; } }A.10B.0C.19D.编译出错

  • 查看答案
  • 有如下类定义:class Test { private int x; publi

    [单选题]有如下类定义: class Test { private int x; public int y; public void setX (int m) {x=m;} public int getX( ) {return x;} }现用Test t=new Text();生成一个对象t,则如下语句中,错误的是( )。A.t.x=10;B.t.y=10;C.t. setX(10);D.int m=t.getX( );

  • 查看答案
  • 下列关于Test类的定义中,正确的是______。A) class Test i