1.public class test&e

题目

1.public class test (  2.public static void main (String args[])    {  3.int  i = 0xFFFFFFF1;  4.int  j = ~i;  5.    6.}  7.)    What is the decimal value of j at line 5?()  

  • A、 0
  • B、 1
  • C、 14
  • D、 –15
  • E、 An error at line 3 causes compilation to fail.
  • F、 An error at line 4 causes compilation to fail.
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

下面程序输出的结果为

#include"iostream.h"

class A

{

public:

A( ){cout<<"CLASS A"<<endl;}

~A( ){}

};

class B:public A

{

public:

B( ){cout<<"CLASS B"<<endl;}

~B( ){}

};

void main( )

{

A*p;

p=new B;

B *q;

q=new B;

}

A.CLASS A CLASS B

B.CLASS A CLASS B CLASS B

C.CLASS A CLASS B CLASS A CLASS B

D.CLASS A CLASS B CLASS B CLASS B


正确答案:C
解析:每实例化一个类就要调用其构造函数,结束运行该实例后调用析构函数。注意:类的实例化和构造函数、析构函数的调用方式和何时调用。

第2题:

The IP address 192.168.100.1 belongs to which class of IP address space?()

A. Class A

B. Class B

C. Class C

D. Class D


参考答案:C

第3题:

1.public class GC{2.private Objec to;3.private void doSomethingElse(Object obj){o=obj;}4.public void doSomething(){5.Object o=new Object();6.doSomethingElse(o);7.o=new Object();8.doSomethingElse(null);9.o=null;10.}11.}When the doSomething method is called,after which line does the Object created in line 5 become available for garbage collection?()

A.Line5

B.Line6

C.Line7

D.Line8

E.Line9

F.Line10


参考答案:D

第4题:

Which statement is NOT true concerning the stowage of class 1 explosives ________.

A.Class 1.1 explosives may be stowed with class 9 dangerous substances

B.Class 1.4 explosives must be“separated from”a stow of class 5.1 oxidizing materials

C.Class 1.4 explosives may not be stowed in the same hold with class 6.1 poisons

D.Class 1.4 explosives must be“separated from”a stow of class 8 corrosive materials


正确答案:C

第5题:

下面程序输出的结果为( )。 #inClUde”iostream.h” Class A {public: A(){cout<<“CLASS A”<<endl;} ~A()<)}; class B:public A {public: B(){cout<<”CLASSB”<<endl;} ~B(){}}; void main() {A*p; p=new B; B *q; q=new B;}

A.CLASS A CLASS B

B.CLASS A CLASS B CLASS B

C.CLASS A ClASS B

D.CLASS A CLASS B CLASS A CLASS B CLASS B CLASS B


正确答案:C
解析: 本题考查类的继承、类的实例化和构造函数、析构函数的调用方式和何时调用。每实例化一个类就要调用其构造函数,结束运行该实例后调用析构函数。

第6题:

Class a = new Class(); Class b = new Class();

if(a == b) returns true or false, why?


正确答案:
               

第7题:

下面程序输出的结果为 #include"iostream.h” class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASS B"<<endl;} ~B(){} }; void main() { A*p; p=new B;

A.CLASS A CLASS B CLASS B CLASS B

B.CLASS A CLASS B CLASS A CLASS B

C.CLASS A CLASS B CLASS B

D.CLASS A CLASS B


正确答案:C

第8题:

下面程序输出的结果为 #include"iostream.h" class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASSB"<<endl;} ~B() {} }; void main() { A * p; p=new B; B *q; q=new B; }

A.CLASS A CLASS B

B.CLASS A CLASS B CLASS B

C.CLASS A CLASS B CLASS A CLASS B

D.CLASS A CLASS B CLASS B CLASS B


正确答案:C
解析:每实例化一个类就要调用其构造函数,结束运行该实例后调用析构函数。注意:类的实例化和构造函数、析函数的调用方式和何时调用。

第9题:

对于下面( )类定义,可以通过“newJ_Class()”生成类J_Class的实例对象。

A、publicclassJ_Class{

publicJ_Class(void){}

}

B、publicclassJ_Class{}

C、publicclassJ_Class{

publicJ_Class(Strings){}

}

D、publicclassJ_Class{

publicvoidJ_Class(){}

publicJ_Class(Strings){}


正确答案:B

第10题:

GPRS手机类型可分为()。

  • A、CLASS A
  • B、CLASS B
  • C、CLASS C
  • D、CLASS D

正确答案:A,B,C

更多相关问题