网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

类Test1定义如下: 1.public class Test1{ 2. public float aMethod(float a,float b){ return 0;} 3. 4.} 将以下哪种方法插入行3是不合法的。()

  • A、public float aMethod(float a, float b,float c){ return 0;}
  • B、public float aMethod(float c,float d){ return 0;}
  • C、public int aMethod(int a, int b){ return 0;}
  • D、private float aMethod(int a,int b,int c){ return 0;}

参考答案

更多 “ 类Test1定义如下: 1.public class Test1{ 2. public float aMethod(float a,float b){ return 0;} 3. 4.} 将以下哪种方法插入行3是不合法的。()A、public float aMethod(float a, float b,float c){ return 0;}B、public float aMethod(float c,float d){ return 0;}C、public int aMethod(int a, int b){ return 0;}D、private float aMethod(int a,int b,int c){ return 0;}” 相关考题
考题 14类Test1定义如下: 1.publicclassTest1{ 2.publicfloataMethod(floata,floatb){} 3. 4.} 将以下哪种方法插入行3是不合法的。() A.public floata Method(floata,floatb,floatc){}B.public floata Method(floatc,floatd){}C.public inta Method(inta,intb){}D.private floata Method(inta,intb,intc){}

考题 有如下类定义: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 . ④

考题 下列代码的执行结果为( )。 public class Test1 { public static void main(String args[]){ hat a=3,b=10; System.out.println((a++)*(--b)); }A.40B.36C.30D.27

考题 有如下程序:includeusing namespace std;Class Test{public:Test(){n+=2;}~Test(){n- 有如下程序: #include<iostream> using namespace std; Class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum() {return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test;A.n=0B.n=1C.n=2D.n=3

考题 下列关于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.

考题 已知如下类说明: public class Test { private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[]) { Test t = new Test(); // 程序代码… } } 如下哪个使用是正确的?() A.t.fB.this.nC.Test.mD.Test.n

考题 在如下源代码文件Test.java中, 哪个是正确的类定义?() A.public class test { public int x = 0; public test(int x) { this.x = x; } }B.public class Test{ public int x=0; public Test(int x) { this.x = x; } }C.public class Test extends T1, T2 { public int x = 0; public Test (int x) { this.x = x; } }D.public class

考题 有如下的类的模板定义: template class MyClass { private:T number; public:MyClass( 有如下的类的模板定义:template <class T>class MyClass{private:T number;public:MyClass(T k);…};其中构造函数MyClass()用k的值初始化数据成员n。因此在模板类体外,构造函数MyClass应定义为【 】。

考题 有如下类定义: 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( );

考题 有如下类定义: 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.④

考题 类testl定义如下: public class test1 { public float amethod(float a,float b){ } }A.public foat amethod(float a,float b,foat c){ }B.public float amethod(float c,float d){ }C.public int amethod(int a,int b){ }D.private float amethod(int a,int b,int c){ }

考题 下列代码的执行结果是( )。 public,class Test1 { public static void main(String args[]) { System.out.println(5/2); } }A.2.5B.2.0C.2.50D.2

考题 有如下类定义: class Test { public: Test{a=0;c=0;}//① int f(im A.const{this-a=a;}//② static int g{return a;f//③ 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 { 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.java中, ( )是正确的类定义。A.public class test{B.public class Test{ public int x=0;public int x=0; public test (intx) public Test (int x){ {this.x=x; this.x=x;} }} }C.public class Test extends T1,T2{D.protected class Test extends T2{ public int=0;public int x=0; public Test(int x){Public Test (int x){ this.x=x;this.x=x: }} }}

考题 在下列源代码文件Test.java中,哪个选项是正确的类定义? ( )A.public class test { public int x=0; public test(int x) { this.x=x; } }B.public class Test { public int x=0; public Test(int x) { this.x=x; } }C.public class Test extends Ti,T2 { public int x=0; public Test(int x) { this.x=x; } }D.protected class Test extends T2 { public int x=0; public Test(int x) { this.x=x; } }

考题 有两个文件test1和test2,test2有内容,现在执行cat test1>>test2,则test2文件内容全部删除。( )

考题 In a customer’s network, VLAN Trunking Protocol (VTP) is running with a domain named main1. VLANs 1,2,3,4,5,10,20 are active on the network. Suddenly the whole network goes down. No traffic is being passed on VLANs 2,3,4,5,10,20, however traffic passes on VLAN 1 and indicates all switches are operational. Right before the network problem occurred, a switch named TEST1 was added to the network.  What three configuration issues on TEST1 could be causing the network outage?()A、TEST1 is configured as a VTP server with a different domain name.B、TEST1 is not configured to participate in VTP.C、TEST1 is configured as a VTP server with the domain name main1.D、TEST1 has a lower VTP configuration revision than the current VTP revision.E、TEST1 has a higher VTP configuration revision than the current VTP revision.F、TEST1 is configured with only VLAN1.

考题 package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?() A、 x = 0B、 x = 42C、 Compilation fails because of an error in line 2 of class Test2.D、 Compilation fails because of an error in line 3 of class Test1.E、 Compilation fails because of an error in line 4 of class Test2.

考题 现有如下包结构:  com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class  和类:  class Test { Alpha a; Beta b; Gamma c; }  哪三个必须加入到类 Test 中,以使其通过编译?()A、package y;B、package com;C、import com.x.*;D、import com.x.y.*

考题 类Test1定义如下:1.publicclassTest1{2.publicfloataMethod(floata,floatb){}3.4.}将以下()方法插入行3是不合法的。A、public float aMethod(floata,floatb,floatc){}B、public float aMethod(floatc,floatd){}C、public int aMethod(inta,intb){}D、private float aMethod(inta,intb,intc){}

考题 单选题在linux系统中,将文件/tmp/test1和/tmp/test2压缩到/tmp/test.gz,正确的命令是()。A tar -czvf test1 test2 test.gzB tar -czvf test.gz test1 test2C tar test.gz test1 test2D tar test1 test2 test.gz

考题 单选题在linux系统中,用cp命令将/tmp/test中的文件到/tmp/test1中,不想拷贝目录本身,以下命令正确的是()。A cp -R /tmp/test /tmp/test1B cp -r /tmp/test /tmp/test1C cp -R /tmp/test/. /tmp/test1D cp /tmp/test /tmp/test1

考题 单选题在linux系统中,删除/test/test1目录,当/test目录为空时,希望一并删除,以下命令中正确的是()。A rmdir -r /test/test1B rmdir -p /test/test1C rmdir -R /test/test1D rmdir -l /test/test1

考题 单选题类Test1定义如下: 1.public class Test1{ 2. public float aMethod(float a,float b){ return 0;} 3. 4.} 将以下哪种方法插入行3是不合法的。()A public float aMethod(float a, float b,float c){ return 0;}B public float aMethod(float c,float d){ return 0;}C public int aMethod(int a, int b){ return 0;}D private float aMethod(int a,int b,int c){ return 0;}

考题 单选题类Test1定义如下:publicclassTest1{publicfloataMethod(floata,floatb){}____}根据方法重载的定义,将以下哪种方法插入下划线部分是不合法的。()A publicfloataMethod(floata,floatb,floatc){}B publicfloataMethod(floatc,floatd){}C publicfloataMethod(inta,intb){}D publicfloataMethod(inta,intb,intc){}

考题 单选题package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?()A  x = 0B  x = 42C  Compilation fails because of an error in line 2 of class Test2.D  Compilation fails because of an error in line 3 of class Test1.E  Compilation fails because of an error in line 4 of class Test2.

考题 单选题1.public class Test{ 2.int x=12; 3.public void method(intx){ 4.x+=x; 5.System.out.println(x); 6.} 7.} Given: 34.Test t=new Test(); 35.t.method(5); What is the output from line 5 of the Test class?()A 5B 10C 12D 17E 24