




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
西安三元數(shù)碼軟件有限公司外派JAVA軟件工程師筆試題4303返回上級目錄選擇題1:在軟件生命周期中,下列哪個說法是不準(zhǔn)確的?A.軟件生命周期分為計劃、開發(fā)和運(yùn)行三個階段B.在計劃階段要進(jìn)行問題焉醛和需求分析C.在開發(fā)后期要進(jìn)行編寫代碼和軟件測試D.在運(yùn)行階段主要是進(jìn)行軟件維護(hù)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”);
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.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:關(guān)于垃圾收集的哪些敘述是對的。A.程序開發(fā)者必須自己創(chuàng)建一個線程進(jìn)行內(nèi)存釋放的工作。B.垃圾收集將檢查并釋放不再使用的內(nèi)存。C.垃圾收集允許程序開發(fā)者明確指定并立即釋放該內(nèi)存。D.垃圾收集能夠在期望的時間釋放被java對象使用的內(nèi)存。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)
System.out.println(“Finish”);
}
}
Which
well
be
output:
A.Doingitforlis3B.Doingitforlis1C.Doingitforlis2D.Doingitforlis07:Whichofthefollowingstatementsaretrue?A.TheautomaticgarbagecollectionoftheJVMpreventsprogramsfromeverrunningoutofmemoryB.AprogramcansuggestthatgarbagecollectionbeperformedandforceitC.GarbagecollectionisplatformindependentD.Anobjectbecomeseligibleforgarbagecollectionwhenallreferencesdenotingitaresettonull.8:下面關(guān)于變量及其范圍的陳述哪些是錯的。A.實(shí)例變量是類的成員變量。B.實(shí)例變量用關(guān)鍵字static聲明。C.在方法中定義的局部變量在該方法被執(zhí)行時創(chuàng)建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
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";C.assertcctld!=null:"Nocountrycodedataisavailable";D.assertcctld:"Nocountrycodedataisavailable";10:在下述選項時,沒有構(gòu)成死循環(huán)的程序是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分配內(nèi)存空間。B.第二行語句創(chuàng)建一個Vector類對象。C.第三行語句創(chuàng)建一個Vector類對象。D.第三行語句為一個Vector類對象分配內(nèi)存空間12:Aclassdesignrequiresthatamembervariableshouldbeaccessibleonlybysamepackage,whichmodiferwordshouldbeused?A.protectedB.publicC.nomodiferD.private13:Give
the
following
java
source
fragement:
//point
x
public
class
Interesting{
//do
something
}
Which
statement
is
correctly
Java
syntax
at
point
x?
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程序代碼片段運(yùn)行后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'
:
{
int
j
=
0;
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.changeprivateintxtofinalintx18:WhicharenotJavakeywords?A.TRUEB.constC.superD.void19:設(shè)有變量說明語句inta=1,b=0;
則執(zhí)行以下程序段的輸出結(jié)果為()。
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個子階段,以下哪一個是正常的開發(fā)順序?A.計劃階段、開發(fā)階段、運(yùn)行階段B.設(shè)計階段、開發(fā)階段、編碼階段C.設(shè)計階段、編碼階段、維護(hù)階段D.計劃階段、編碼階段、測試階段21: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()
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 人家服務(wù)合同范本
- 中班社會領(lǐng)域活動方案
- 房屋雙方買賣合同
- 車輛掛靠經(jīng)營協(xié)議書
- 交通物流配送優(yōu)化方案
- 班車租賃合同集錦
- 智能制造模具研發(fā)投資合同
- 工程機(jī)械施工協(xié)議書
- 新能源材料研發(fā)投資合同
- Unit 3 Amazing animals第4課時(教學(xué)設(shè)計)-2024-2025學(xué)年人教PEP版(2024)英語三年級上冊
- 燈泡貫流式機(jī)組基本知識培訓(xùn)ppt課件
- 小學(xué)數(shù)學(xué)四年級下冊培優(yōu)補(bǔ)差記錄
- 人參無公害標(biāo)準(zhǔn)化生產(chǎn)操作規(guī)程
- 人教版三年級下冊體育與健康教案(全冊教學(xué)設(shè)計)
- DB61∕T 5006-2021 人民防空工程標(biāo)識標(biāo)準(zhǔn)
- 產(chǎn)品結(jié)構(gòu)設(shè)計(課堂PPT)
- 第九課_靜止的生命
- 尖尖的東西我不碰(課堂PPT)
- 工程勘察和設(shè)計承攬業(yè)務(wù)的范圍
- 碳纖維、鋼板加固板計算表(根據(jù)2013版加固規(guī)范 編寫)
- 第二版人民幣暗記大全
評論
0/150
提交評論