平安银行JAVA笔试题二 下载本文

JAVA笔试题

一 单选

1. 使用哪个关键字,使得只能在定义该类的包中的其他类才能访问该类? a. 不使用关键字 b. private c. final d. protected

2. 下列java关键字哪一个与其他不同 ? a. null b. const c. volatile d. transient

3. 下列哪个不是java关键字? a. integer b. double c. class d. default

4. 有程序如下: public class Aclass {

Public void go() {

System.out.pritn(“AClass”); } }

public class Bclass extends Aclass {

Public void go() {

System.out.pritn(“BClass”); }

Public static void main(String[] agr) {

Aclass a = new Aclass(); Aclass a1 = new Bclass(); a.go(); a1.go();

}

}

问输出结果为:

a. 输入“AClassAClass” b. 输入“AClassBClass” c. 输入“BClassBClass” d. 输入“BClassAClass”

5. 下列程序运行结果 public class Acc2 { }

a. 4 b. 3

c. 运行时报错

d. 编译时报错(没有初始化变量 falg)

public static void main(String[] args) { }

int index; boolean flag;

for (index = 0; index < 10 && !flag; index++) { }

if (index > Math.PI) { }

System.out.println(index + \flag = true;

6. 下面代码输出什么? long i = 4; switch(i){ case 1:

System.out.print(\System.out.print(\

default: case 2:

System.out.print(\

case 3:

System.out.print(\ }

a) 编译错误(switch条件里面参数的类型不能为long,只能是short、int、char、byte) b) Error c) ErrorGood d) ErrorGoodBest

7. 下面程序的输出是什么?

System.out.println(Math.floor(-5.5)); a. -6 b. -5 c. -5.0 d. -6.0

8. 配置Weblogic为热启动方式的命令是哪个?

a. Set PROJECT_MODE=true

b. Set PROJECT_TYPE=true c. Set PROJECT_MODE=real d. Set PROJECT_TYPE=real

9. 下列程序i值为 class test { { } }

a) 编译不通过 b) 0 c) 14 d) -15 10.

软件开发需占时间最多的哪个部分

a) 需求设计 b) 代码编写 c) 软件测试 d) 软件维护

11. 下列程序

class A implements Runnable { }

public class B {

public void run() { }

System.out.println(\

int j=0xFFFFFFF1; int i=~j;

public static void main (String []args)