北京神州数码思特奇信息技术股份有限公司JAVA工程建设师笔试题

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1:What is written to the standard output given the following statement:System.out.println(4|7);

Select the right answer:

A.4

B.5

C.6

D.7

2:

What will happen when you attempt to compile and run the following code? public class Static

{

static

{

int x = 5;

}

static int x,y;

public static void main(String args[])

{

x--;

myMethod();

System.out.println(x + y + ++x);

}

public static void myMethod()

{

y = x++ + ++x;

}

Choices:

A.prints : 2

B.prints : 3

C.prints : 7

D.prints : 8

3:Which statements about Java code security are not true?

A.The bytecode verifier loads all classes needed for the execution of a program.

B.Executing code is performed by the runtime interpreter.

C.At runtime the bytecodes are loaded, checked and run in an interpreter.

D.The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.

4:

Select valid identifier of Java:

A.%passwd

B.3d_game

C.$charge

D.this

5:

The following code is entire contents of a file called Example.java,causes precisely one error during compilation:

class SubClass extends BaseClass{

}

class BaseClass(){

String str;

public BaseClass(){

System.out.println(“ok”);}

public BaseClass(String s){

str=s;}}

public class Example{

public void method(){

SubClass s=new SubClass(“hello”);

BaseClass b=new BaseClass(“world”);

}

Which line would be cause the error?

A.9

B.10

C.11

D.12

6:Use the operator “>>” and “>>>”. Which statement is true?

A.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 0000 1010 0000 0000 0000 0000 0000 0000

B.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 1111 1010 0000 0000 0000 0000 0000 0000

C.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 0000 0000 0000 0000 0000 0000 0000 0000

D.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 1111 1010 0000 0000 0000 0000 0000 0000

7:

What results from attempting to compile and run the following code? public class Ternary

{

public static void main(String args[])

{

int a = 5;

System.out.println("Value is - " + ((a < 5) ? 9.9 : 9));

}

}

Choices:

A.prints: Value is - 9

pilation error

C. prints: Value is - 5

D.None of these

相关文档
最新文档