下列程序段的输出结果是______。 public class Test{ int a,b; Test( ){ a=100; b=200; } Test(int x,int y){ a=X; b=y; } public static void main(String args[ ]){ Test Obj1=new Test(12,45); System.out.println("a="+Obj1.a+"b="+Obj1.B); Test Obj2=new Test( ); System.out.println("a="+Obj1.a+"b="+Obj1.B); } }A.a=100 b=200 a=12 b=45B.a=12 b=45 a=100 b=200C.a=12 b=200 a=100 b=45D.a=100 b=45 a=12 b=200

下列程序段的输出结果是______。 public class Test{ int a,b; Test( ){ a=100; b=200; } Test(int x,int y){ a=X; b=y; } public static void main(String args[ ]){ Test Obj1=new Test(12,45); System.out.println("a="+Obj1.a+"b="+Obj1.B); Test Obj2=new Test( ); System.out.println("a="+Obj1.a+"b="+Obj1.B); } }

A.a=100 b=200 a=12 b=45

B.a=12 b=45 a=100 b=200

C.a=12 b=200 a=100 b=45

D.a=100 b=45 a=12 b=200


相关考题:

已知程序中已经定义了函数test,其原型是int test(int,int,int);,则下列重载形式中正确的是A.char test (int,int,int);B.double test(int,int,double);C.int test(int,int,int=O);D.float test(int,int,float=3.5F);

下列程序的运行结果是【 】。 include class test { private: int num; public: tes 下列程序的运行结果是【 】。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;}

下列程序的运行结果是______。 include class test { private: int hum; public: tes 下列程序的运行结果是______。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;}

已知程序中已经定义了函数test,其原型是int test(int, int, int);,则下列重载形式中正确的是A.char test(int,int,int);B.double test(int,int,double);C.int test(int,int,int=0);D.float test(int,int,float=3.5F);

已知程序中已经定义了函数test,其原型是int test (int,int,int);,则下列重载形式中正确的是( )。A.char test(int, int, int);B.double test (int,int,double);C.int test(int ,int, int=0);D.float test(int,int,float=3.5F);

下列程序的输出结果是______。 include using namespace std; class Test( public: Te 下列程序的输出结果是______。 #include<iostream> using namespace std; class Test( public: Test() {cnt++;} ~Test() {cnt--;} static int Count(){return cnt;} private: static int cnt; }; int Test::cnt=0; int main() { cout<<Test::Count()<<""; Test t1,t2; Test*pT3=new Test; Test*pT4=new Test; cout<<Test::Count()<<""; delete pT4; delete pT3; cout<<Test::Count()<<end1; return 0; }A.024B.042C.420D.240

如下程序编译时发生错误,错误的原因是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( );}

以下标识符哪些是合法的?哪些是Java的关键字? miles, Test, a++, --a, 4#R, $4, #44, apps,class, public, int, x, y, min value, 成绩, radius,最大值max。

00330038003000301585067361821下列程序段执行结果是___________。 x = 1 print(type(x)) x = 1.0 print(type(x)) x = '1.0' print(type(x)A.<class 'int'> <class 'float'> <class 'str'>B.<class 'float'> <class 'int'> <class 'str'>C.<class 'str'> <class 'float'> <class 'int'>D.<class 'str'> <class 'int'> <class 'float'>

下列程序段执行结果是___________。 x = 1 print(type(x)) x = 1.0 print(type(x)) x = '1.0' print(type(x)A.<class 'int'> <class 'float'> <class 'str'>B.<class 'float'> <class 'int'> <class 'str'>C.<class 'str'> <class 'float'> <class 'int'>D.<class 'str'> <class 'int'> <class 'float'>