java高级工程师笔试题

选择题

1:which is the main() method return of a application?

a.string

b.byte

c.char

d.void

2:

what will happen when you attempt to compile and run the following code?

int output = 10;

boolean b1 = false;

if((b1 true) && ((output += 10) 20))

{

system.out.println("we are equal " + output);

}

else

{

system.out.println("not equal! " + output);

}

choices:

what will happen when you attempt to compile and run the following code?

int output = 10;

boolean b1 = false;

if((b1 true) && ((output += 10) 20))

{

system.out.println("we are equal " + output);

}

else

{

system.out.println("not equal! " + output);

}

choices:

a.compilation error, attempting to perform binary comparison on logical data type

b.compilation and output of "we are equal 10".

c.compilation and output of "not equal! 20".

d.compilation and output of "not equal! 10".

3:

what will happen when you attempt to compile and run the following code?

class base

{

int i = 99;

public void amethod()

{

system.out.println("base.amethod()");

}

base()

{

amethod();

}

}

public class derived extends base

{

int i = -1;

public static void main(string argv[])

{

base b = new derived();

system.out.println(b.i);

b.amethod();

}

public void amethod()

{

system.out.println("derived.amethod()");

}

}

choices:

what will happen when you attempt to compile and run the following code?

class base

{

int i = 99;

public void amethod()

{

system.out.println("base.amethod()");

}

base()

{

amethod();

}

}

public class derived extends base

{

int i = -1;

public static void main(string argv[])

{

base b = new derived();

system.out.println(b.i);

b.amethod();

}

public void amethod()

{

system.out.println("derived.amethod()");

}

}

choices:

a.derived.amethod() -1 derived.amethod()

b.derived.amethod() 99

c.compile time error

d.derived.amethod()

4:

下述程序代码中有语法错误的行是( )。

int i,ia[10],ib[10]; /*第一行*/

for (i=0;i<=9;i++) /*第2行*/

ia[i]=0; /*第3行*/

ib=ia; /*第4行*/

下述程序代码中有语法错误的行是( )。

int i,ia[10],ib[10]; /*第一行*/

for (i=0;i<=9;i++) /*第2行*/

ia[i]=0; /*第3行*/

ib=ia; /*第4行*/

a.第1行

b.第2行

c.第3行

d.第4行

5:

what will be the result of executing the following code?

// filename; superclassx.java

package packagex;

public class superclassx

{

protected void superclassmethodx()

{

}

int superclassvarx;

}

// filename subclassy.java

1.package packagex.packagey;

2.

3.public class subclassy extends superclassx

4.{

5.superclassx objx = new subclassy();

6.subclassy objy = new subclassy();

7.void subclassmethody()

8.{

9.objy.superclassmethodx();

10.int i;

11.i = objy.superclassvarx;

12.}

13.}

choices:

what will be the result of executing the following code?

// filename; superclassx.java

package packagex;

public class superclassx

{

protected void superclassmethodx()

{

}

int superclassvarx;

}

// filename subclassy.java

1.package packagex.packagey;

2.

3.public class subclassy extends superclassx

4.{

5.superclassx objx = new subclassy();

6.subclassy objy = new subclassy();

7.void subclassmethody()

8.{

9.objy.superclassmethodx();

10.int i;

11.i = objy.superclassvarx;

12.}

13.}

choices:

a.compilation error at line 5

b.compilation error at line 9

c.runtime exception at line 11

d.none of these

6:which are not java keywords?

a.true

b.const

c.super

d.void

7: consider the class hierarchy shown below:

——————————————————————————————————

class fourwheeler implements drivingutilities

class car extends fourwheeler

class truck extends fourwheeler

class bus extends fourwheeler

class crane extends fourwheeler

———————————————————————————————————

consider the following code below:

1.drivingutilities du;

2.fourwheeler fw;

3.truck mytruck = new truck();

4.du = (drivingutilities)mytruck;

5.fw = new crane();

6.fw = du;

which of the statements below are true?

choices:

a.line 4 will not compile because an interface cannot refer to an object.

b.the code will compile and run.

c.the code will not compile without an explicit cast at line 6, because going down the hierarchy without casting is not allowed.

d.the code will compile if we put an explicit cast at line 6 but will throw an exception at runtime.

8:exhibit :

1. public class test (

2. private static int j = 0;

3.

4. private static boolean methodb(int k) (

5. j += k;

6. return true;

6. )

7.

8. public static void methoda(int i) {

9. boolean b:

10. b = i < 10 | methodb (4);

11. b = i < 10 || methodb (8);

12. )

13.

14. public static void main (string args[] } (

15. methoda (0);

16. system.out.printin(j);

17. )

18. )

what is the result?

a.the program prints “0”

b.the program prints “4”

c.the program prints “8”

d.the program prints “12”

9:

public class outerclass {

private double d1 = 1.0;

//insert code here

}

you need to insert an inner class declaration at line 3. which two inner class declarations are

valid?

public class outerclass {

private double d1 = 1.0;

//insert code here

}

you need to insert an inner class declaration at line 3. which two inner class declarations are

valid?

a.class innerone{ public static double methoda() {return d1;} }

b.public class innerone{ static double methoda() {return d1;} }

c.private class innerone{ double methoda() {return d1;} }

d.static class innerone{ protected double methoda() {return d1;} }

10:

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?

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

11:

string s=”example string”;which operation is not legal?

string s=”example string”;which operation is not legal?

a.int i=s.length();

b.s[3]=”x”;

c.string short_s=s.trim();

d.string t=”root”+s;

12:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序?

a.计划阶段、开发阶段、运行阶段

b.设计阶段、开发阶段、编码阶段

c.设计阶段、编码阶段、维护阶段

d.计划阶段、编码阶段、测试阶段

13: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.

14:a class design requires that a member variable should be accessible only by same package, which modifer word should be used?

a.protected

b.public

c.no modifer

d.private

15:

give the following method:

public void method( ){

string a,b;

a=new string(“hello world”);

b=new string(“game over”);

system.out.println(a+b+”ok”);

a=null;

a=b;

system.out.println(a);

}

in the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.

give the following method:

public void method( ){

string a,b;

a=new string(“hello world”);

b=new string(“game over”);

system.out.println(a+b+”ok”);

a=null;

a=b;

system.out.println(a);

}

in the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.

a.before line 5

b.before line 6

c.before line 7

d.before line 9

简答题

16:请阐述一下你对java多线程中“锁”的概念的理解。

17:列出jsp中包含外部文件的方式,两者有何区别。

18:请谈谈对一个系统设计的总体思路。针对这个思路,你觉得应该具备哪些方面的知识?

19:struts2中的拦截器,你用过那些自带的.拦截器,自己写过的吗?

20:怎样在复杂的各种形式的网页中提取mp3下载的结构化数据?

21:编写一个在二叉排序树中查找大小为第k的元素的算法。

22:java多线程编程。 用java写一个多线程程序,如写四个线程,二个加1,二个对一个变量减一,输出。

23:不允许使用系统时间,写出一个随机数生成函数。

24:hibernate中的id(主键)生成器有那些?或者你常用的是那些?

25:error和exception有什么区别?

java高级工程师笔试题含答案_java高级工程师笔试题相关推荐

  1. 最新前端开发面试笔试题及答案---图片(面试题系列持续更新中)(4)

    推荐文章: VUE之VUEX常见面试题大全汇总--史上最全[vuex面试题] 前端面试题之HTML+CSS(持续更新)_勤动手多动脑少说多做厚积薄发-CSDN博客1.行内元素和块级元素?img算什么? ...

  2. 最新前端开发面试笔试题及答案---图片(面试题系列持续更新中)(8)

    推荐文章: VUE之VUEX常见面试题大全汇总--史上最全[vuex面试题] 前端面试题之HTML+CSS(持续更新)_勤动手多动脑少说多做厚积薄发-CSDN博客1.行内元素和块级元素?img算什么? ...

  3. 最新前端开发面试笔试题及答案---图片(面试题系列持续更新中)(3)

    推荐文章: VUE之VUEX常见面试题大全汇总--史上最全[vuex面试题] 前端面试题之HTML+CSS(持续更新)_勤动手多动脑少说多做厚积薄发-CSDN博客1.行内元素和块级元素?img算什么? ...

  4. 最新前端开发面试笔试题及答案---图片(面试题系列持续更新中)(1)

    推荐文章: VUE之VUEX常见面试题大全汇总--史上最全[vuex面试题] 前端面试题之HTML+CSS(持续更新)_勤动手多动脑少说多做厚积薄发-CSDN博客1.行内元素和块级元素?img算什么? ...

  5. 北大青鸟Java内侧答案_北大青鸟推荐:Java精选笔试题(含答案解析)

    北大青鸟推荐:Java精选笔试题(含答案解析)如果你是计算机专业出生,但是还没有找到工作的话,你就得补补技术了,一些关于面试.笔试的题要多刷一刷.有可能你知道答案,但是由于语言组织能力有所欠缺,所以面 ...

  6. java 字符串乱码_这份Java面试题含答案解析竟然真的让你不用在面试上“如履薄冰”...

    面试题集共分为以下十部分: 一.Core Java: 1 - 95 题1 - 24 页 基础及语法: 1 - 61 题1 - 13 页 异常: 62 - 69 题13 - 15 页 集合: 70 - ...

  7. vf省计算机考试题库,四川省33次计算机等级考试vf笔试题(含答案).

    四川省33次计算机等级考试vf笔试题(含答案). (6页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦! 24.9 积分 ...第一部分 软件技术基础一.是非 ...

  8. c语言错误 xef代表什么,C语言(次)笔试题含答案【DOC精选】.doc

    C语言(次)笔试题含答案[DOC精选] 第二十二次等级考试 二级(C与C++语言) 笔 试 试 卷 时间: 2005年4月16日 上午 9:00-11:00 第一部分 软件技术基础 (共15分) 一. ...

  9. C语言控制流编程试题,可编程序控制系统设计师(中级)职业认证理论考试试题(含答案).doc...

    可编程序控制系统设计师(中级)职业认证理论考试试题(含答案).doc 可编程序控制系统设计师(中级)职业认证理论考试试题(含答案) 一.单项选择题 1.以下对S7-200PLC变量存储器V描述不正确的 ...

最新文章

  1. 差异表达基因富集结果可视化
  2. 机器学习工程师需要具备的5种软技能
  3. sql server支持gb18030里面的疑难中文字
  4. 普平数据招聘:数据中心建设项目经理(工程部 )2人
  5. esp32 怎么分配freertos 堆栈大小_嵌入式开发入门-从STM32CudeMX、FreeRtos、Proteu仿真开始...
  6. 高级php平时的工作,【高级PHP开发工作内容|工作职责|高级PHP开发做什么】-看准网...
  7. 计算机组装与维修bios设置,(完整版)计算机组装与维修模拟试题(BIOS设置的习题).docx...
  8. php员工积分绩效,详解绩效积分奖励制
  9. 三观碎一地:轮子天天见,车轮悖论却2000年无解?
  10. luogu 1344 追查坏牛奶(最小割)
  11. 「ECharts」交互 API (echarts、echartsInstance)
  12. Linux操作Oracle(10)——plsql配置Oracle客户端方法【Oracle客户端安装、资源下载】详细教程
  13. 20210218:力扣第228周周赛(下)
  14. Android studio 升级指定dradle
  15. 事务和异常易出现的错误
  16. 网易云音乐api资料
  17. 职高c语言补充程序,江苏省2013年职高对口升学《C语言程序设计》冲刺模拟试题 免费.doc...
  18. java的hashmap排序_Java HashMap两种简便排序方法解析
  19. Gateway 出现Can not connect to tcp://127.0.0.1: Connection refused
  20. cad2010背景怎么调成黑色_iOS14桌面怎么布局好看-热点资讯-

热门文章

  1. 开源SDS引领未来存储
  2. linux arm 地址映射 ioremap_nocache 使用,ioremap_nocache 函数分析(二)
  3. c++中各种长度整型的分析
  4. 人工智能写唐诗完整项目文档(含代码)tensorflow+keras实现
  5. 三种创建线程方式之Callable接口
  6. linux下使用Mongodb命令笔记
  7. 信息奥赛一本通1215:迷宫
  8. MPEG4码流的帧率计算
  9. 集成【支付宝】实现支付功能
  10. 实验一——病毒注册表操作