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

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

下列代码中,将引起一个编译错误的行是( )。 1)public class Test{ 2)int m,n; 3)public Test{} 4)public Test(int a){m=a;) 5)public static void main(String args[]){ 6)Test tl,t2; 7)int j,k; 8)j=0;k=0; 9)tl=new Test; 10)t2=new Test(j,k); 11)} 12)}

A.第3行

B.第5行

C.第6行

D.第l0行


参考答案

更多 “ 下列代码中,将引起一个编译错误的行是( )。 1)public class Test{ 2)int m,n; 3)public Test{} 4)public Test(int a){m=a;) 5)public static void main(String args[]){ 6)Test tl,t2; 7)int j,k; 8)j=0;k=0; 9)tl=new Test; 10)t2=new Test(j,k); 11)} 12)}A.第3行B.第5行C.第6行D.第l0行 ” 相关考题
考题 下列代码中,将引起编译错误的行是( )。 ① public class test{ ② public static void main(String args[]){ ③ float f=0.0; ④ f+=0; ⑤ } ⑥ }A.第2行B.第3行C.第4行D.第6行

考题 有如下程序: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

考题 有如下程序: #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

考题 已知如下类说明: 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

考题 下列程序的执行结果是 ( ) public class Test { public int aMethod() { satic int i=0; i++; System.out.println(i); } public static void.main(String args[]) { Test test=new Test(); test.aMethod(); }A.编译错误B.0C.1D.运行成功,但不输出

考题 有如下程序: include using namespace std; class Test { public 有如下程序: #include<iostream> using namespace std; class Test { public: Test(){n+=2;} ~Test(){n-=3;} static int getNum(){return n;} private: static int n; }; int Tesl::n=1 int main() { Test*p=new Test; delete p; cout<<"n="<<Tes::tgetNum()<<endl; return 0; } 执行后的输出结果是A.n=0B.n=1C.n=2D.n=3

考题 已知有下列类的说明,则下列哪个语句是正确的?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.f;B.this. nC.Test.m;D.Test.f;

考题 下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

考题 有如下程序: include using namespace std; class Test{ public: Tes 有如下程序: #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; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行后的输出结果是( )。A.n=0B.n=1C.n=2D.n=3

考题 下列代码中,将引起一个编译错误的行是 1) public class Test{ 2) int m,n; 3) public Test(){} 4) public Test(inta){m=a;} 5) public static void main(String args[]){ 6) Test t1,t2; 7) int j,k; 8) j=0;k=0; 9) t1=new Test(); 10) t2=new Test(j,k); 11) } 12) }A.第3行B.第5行C.第6行D.第10行

考题 如下程序的输出结果是includeusing namespace std;class Test{public:Test( ){n+=2;} 如下程序的输出结果是 #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: delete P; cout<<"n="<<Test::getNum( )<<endl; return 0; }A.n=0B.n=1C.n=2D. n=3

考题 下列代码中,将引起一个编译错误的行是( )。 1)public class Test{ 2) int m,n; 3) public Test(){} 4) public Test(int a){m=a;} 5) public static void main(String args[]){ 6) Test t1,t2; 7) int j,k; 8) j=0;k=0; 9) t1=new Test(); 10) t2=new Test(j,k); 11) } 12)}A.第3行B.第5行C.第6行D.第10行

考题 在下列源代码文件Test.java中,正确定义类的代码是( )。A.pblic 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.protected class Test extends T2{ public int x = 0; public Test(int x) { this. x = x; } }

考题 有如下程序:include usingnamespacestd: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;}privaue: static int n:};int Test::n=1;int main(){ Test* p=new Test; delete p; cout<<"n="<<Test::getNum()<<end1; return 0;} 执行后的输出结果是A.n=0B.n=1C.n=2D.n=3

考题 下列代码中,将引起编译错误的行是______。 (1) public class Test { (2) int m,n; (3) public Test( ){} (4) public Test(int A){m=a;} (5) public static void main(String args[ ]){ (6) Test t1,t2; (7) int j,k; (8) j=0;k=0; (9) t1=new Test( ); (10) t2=new Test(j,k); (11) 1 (12) }A.第3行B.第5行C.第6行D.第10行

考题 有如下程序:include using namespace std;class Test{public:Test(){n+=2; }~Test(){ 有如下程序: #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; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行该程序的输出结果是( )。A.n=0B.n=1C.n=2D.n=3

考题 3下列代码中,将引起一个编译错误的行是( )。 1)public class Test{ 2)int m,n; 3)public Test(){} 4)public Test(int a){m=a;} 5)public static void main(String args[]){ 6)Test t1,t2; 7)int j,k; 8)j=0; k=0; 9) t1=new Test(); 10)t2=new Test(j,k); 11)} 12)}A.第3行B.第5行C.第6行D.第10行

考题 有如下程序: include using namespace std;class Test {public: Test() {n+=2;} ~Tes 有如下程序: #include <iostream> using namespace std; class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){retum n;} private: static int n; }; int Test:: n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test:: getNum()<<end1; return 0; };执行后的输出结果是______.A.n=0B.n=1C.n=2D.n=3

考题 已知有下列类的说明,则下列哪个语句是正确的? ( ) public class Test { private float f=1.0f; int m=2; static int n=1; public static void main(String arg[]) { Test t=new Test(); } }A.t.f;B.this,n;C.Test.m;D.Test.f;

考题 下列代码中,将引起一个编译错误的行是( )。 1)public class Test{ 2)intm,n; 3)publicTest(){} 4)publicTest(int a){m=a;} 5)publicstaticvoidmain(Stringargs[]){ 6)Testt1,t2; 7)intj,k; 8)j=0;k=0; 9)t1=new Test(); 10)t2=newTest(j,k); 11)} 12)}A.第3行B.第5行C.第6行D.第10行

考题 有下列程序: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()A.n=0B.n=lC.n=2D.n=3

考题 下列代码的执行结果是( )。public class Test{public int aMethod( ){static int i=0;i++;System.out.println(i):}public static void main (String args[]){Trest test=new Test ( );test aMethod( ):}}A.编译错误B.0C.1D.运行成功,但不输出B.C.D.

考题 在下列源代码文件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: }} }}

考题 已知有下列类的说明,则下列哪个语句是正确的? 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.f;B.this.n;C.Test.m;D.Test.f;

考题 在下列源代码文件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.protected class Test extends T2 { public int x=0; public Test(int 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; } }