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

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

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行


参考答案

更多 “ 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行 ” 相关考题
考题 有如下程序: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

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

考题 如下程序的输出结果是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

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

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

考题 有下列程序: include using namespace std; classTest{ public: Test(){n+=2;} ~Test 有下列程序: #include<iostream> using namespace std; classTest{ 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 TestA.n=0B.n=lC.n=2D.n=3

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

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

考题 如下程序编译时发生错误,错误的原因是show函数实现语句错误,则正确的语句应该为______。include<iostream.h>class test{private:int hum;public:test(int);void show( );};test::test(int n){num=n;}test::show( ){cout<<num<<endl;}void main( ){test T(10):T.show( );}