java工程师面试题_第1页
java工程师面试题_第2页
java工程师面试题_第3页
java工程师面试题_第4页
java工程师面试题_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

java工程师面试题西安三元数码软件有限公司外派JAVA软件工程师笔试题4303返回上级目录选择题1:在软件生命周期中,下列哪个说法是不准确的?A.软件生命周期分为计划、开发和运行三个阶段B.在计划阶段要进行问题焉醛和需求分析C.在开发后期要进行编写代码和软件测试D.在运行阶段主要是进行软件维护2:publicclassParent{

intchange(){…}

}

classChildextendsParent{

}

WhichmethodscanbeaddedintoclassChild?A.publicintchange(){}B.abstractintchang(){}C.privateintchange(){}D.none3: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”);

java工程师面试题全文共10页,当前为第1页。

a=null;

java工程师面试题全文共10页,当前为第1页。

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.beforeline5B.beforeline6C.beforeline7D.beforeline94:String

s=”Example

String”;Which

operation

is

not

legal?

A.inti=s.length();B.s[3]=”x”;C.Stringshort_s=s.trim();D.Stringt=”root”+s;5:关于垃圾收集的哪些叙述是对的。A.程序开发者必须自己创建一个线程进行内存释放的工作。B.垃圾收集将检查并释放不再使用的内存。C.垃圾收集允许程序开发者明确指定并立即释放该内存。D.垃圾收集能够在期望的时间释放被java对象使用的内存。6:Give

the

following

code:

public

class

Example{

public

static

void

main(String

args[]

){

int

l=0;

do{

System.out.println(“Doing

it

for

l

is:”+l);

}while(--l>0)

java工程师面试题全文共10页,当前为第2页。System.out.println(“Finish”);

java工程师面试题全文共10页,当前为第2页。}

}

Which

well

be

output:

A.Doingitforlis3B.Doingitforlis1C.Doingitforlis2D.Doingitforlis07:Whichofthefollowingstatementsaretrue?A.TheautomaticgarbagecollectionoftheJVMpreventsprogramsfromeverrunningoutofmemoryB.AprogramcansuggestthatgarbagecollectionbeperformedandforceitC.GarbagecollectionisplatformindependentD.Anobjectbecomeseligibleforgarbagecollectionwhenallreferencesdenotingitaresettonull.8:下面关于变量及其范围的陈述哪些是错的。A.实例变量是类的成员变量。B.实例变量用关键字static声明。C.在方法中定义的局部变量在该方法被执行时创建D.局部变量在使用前必须被初始化。9:Which

is

the

most

appropriate

code

snippet

that

can

be

inserted

at

line

18

in

the

following

code?

(Assume

that

the

code

is

compiled

and

run

with

assertions

enabled)

1.

import

java.util.*;

2.

3.

public

class

AssertTest

java工程师面试题全文共10页,当前为第3页。

java工程师面试题全文共10页,当前为第3页。4.

{

5.

private

HashMap

cctld;

6.

7.

public

AssertTest()

8.

{

9.

cctld

=

new

HashMap();

10.

cctld.put("in",

"India");

11.

cctld.put("uk",

"United

Kingdom");

12.

cctld.put("au",

"Australia");

13.

//

more

code...

14.

}

15.

//

other

methods

16.

public

String

getCountry(String

countryCode)

17.

{

18.

//

What

should

be

inserted

here?

19.

String

country

=

(String)cctld.get(countryCode);

20.

return

country;

21.

}

22.

}

A.assertcountryCode!=null;B.assertcountryCode!=null:"Countrycodecannotbenull";java工程师面试题全文共10页,当前为第4页。C.assertcctld!=null:"Nocountrycodedataisavailable";java工程师面试题全文共10页,当前为第4页。D.assertcctld:"Nocountrycodedataisavailable";10:在下述选项时,没有构成死循环的程序是A.inti=100while(1){i=i%100+1;if(i>100)break;}B.for(;;);C.intk=1000;do{++k;}while(k>=10000);D.ints=36;while(s);--s;11:给出下面的代码片断。。。下面的哪些陈述为错误的?

1)

public

void

create()

{

2)

Vector

myVect;

3)

myVect

=

new

Vector();

4)

}

A.第二行的声明不会为变量myVect分配内存空间。B.第二行语句创建一个Vector类对象。C.第三行语句创建一个Vector类对象。D.第三行语句为一个Vector类对象分配内存空间12:Aclassdesignrequiresthatamembervariableshouldbeaccessibleonlybysamepackage,whichmodiferwordshouldbeused?A.protectedB.publicC.nomodiferD.private13:Give

the

following

java

source

fragement:

//point

x

public

class

Interesting{

//do

something

}

java工程师面试题全文共10页,当前为第5页。Which

statement

is

correctly

Java

syntax

at

point

x?

java工程师面试题全文共10页,当前为第5页。A.publicclassMyClass{//dootherthing…}B.staticintPI=3.14C.classMyClass{//dosomething…}D.none14:WhichfragmentsarenotcorrectinJavasourcefile?A.packagetestpackage;publicclassTest{//dosomething...}B.importjava.io.*;packagetestpackage;publicclassTest{//dosomething...}C.importjava.io.*;classPerson{//dosomething...}publicclassTest{//dosomething...}D.importjava.io.*;importjava.awt.*;publicclassTest{//dosomething...}15:以下的C程序代码片段运行后C和d的值分别是多少

Inta=1,b=2;

Intc,d;

c=(a&b)&&a;

d=(a&&b)&a;A.0,0B.0,1C.1,0D.1,116:What

will

be

the

result

of

executing

the

following

code?

public

static

void

main(String

args[])

{

char

digit

=

'a';

for

(int

i

=

0;

i

<

10;

i++)

{

switch

(digit)

{

case

'x'

:

{

java工程师面试题全文共10页,当前为第6页。

int

j

=

0;

java工程师面试题全文共10页,当前为第6页。

System.out.println(j);

}

default

:

{

int

j

=

100;

System.out.println(j);

}

}

}

int

i

=

j;

System.out.println(i);

}

Choices:

A.100willbeprinted11times.B.Thecodewillnotcompilebecausethevariableicannotbedeclaredtwicewithinthemain()method.C.Thecodewillnotcompilebecausethevariablejcannotbedeclaredtwicewithintheswitchstatement.D.Noneofthese.17:Give

this

class

outline:

class

Example{

private

int

x;

//rest

of

class

body…

}

Assuming

that

x

invoked

by

the

code

java

Example,

which

statement

can

made

x

be

directly

accessible

in

main()

method

of

Example.java?

A.ChangeprivateintxtopublicintxB.changeprivateintxtostaticintxC.ChangeprivateintxtoprotectedintxD.changeprivateintxtofinalintxjava工程师面试题全文共10页,当前为第7页。18:WhicharenotJavakeywords?java工程师面试题全文共10页,当前为第7页。A.TRUEB.constC.superD.void19:设有变量说明语句inta=1,b=0;

则执行以下程序段的输出结果为()。

switch(a)

{

case1:

switch(b)

{

case0:printf("**0**");break;

case1:printf("**1**");break;

}

case2:printf("**2**");break;

}

printf("\n");A.**0**B.**0****2**C.**0****1****2**D.有语法错误20:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序?A.计划阶段、开发阶段、运行阶段B.设计阶段、开发阶段、编码阶段C.设计阶段、编码阶段、维护阶段D.计划阶段、编码阶段、测试阶段21:What

will

happen

when

you

attempt

to

compile

and

run

the

following

code?

java工程师面试题全文共10页,当前为第8页。class

Base

java工程师面试题全文共10页,当前为第8页。

{

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();

}

java工程师面试题全文共10页,当前为第9页。

public

void

amethod()

java工程师面试题全文共10页,当前

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论