




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
西安三元數(shù)碼軟件有限公司外派JAVA軟件工程師筆試題4303返回上級目錄選擇題1:在軟件生命周期中,下列哪個說法是不準確的?A.軟件生命周期分為計劃、開發(fā)和運行三個階段B.在計劃階段要進行問題焉醛和需求分析C.在開發(fā)后期要進行編寫代碼和軟件測試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”);
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:關于垃圾收集的哪些敘述是對的。A.程序開發(fā)者必須自己創(chuàng)建一個線程進行內(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:下面關于變量及其范圍的陳述哪些是錯的。A.實例變量是類的成員變量。B.實例變量用關鍵字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:在下述選項時,沒有構成死循環(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程序代碼片段運行后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:設有變量說明語句inta=1,b=0;
則執(zhí)行以下程序段的輸出結果為()。
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ā)階段、運行階段B.設計階段、開發(fā)階段、編碼階段C.設計階段、編碼階段、維護階段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)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年光纖用GECL4項目資金申請報告代可行性研究報告
- 2024年原奶項目項目投資籌措計劃書代可行性研究報告
- 醫(yī)療協(xié)同政策解讀課件教學
- 融資平臺項目制管理辦法
- 衡陽市固體廢物管理辦法
- 街道應急消防車管理辦法
- 裝配式物業(yè)用房管理辦法
- 西安市能源管理辦法規(guī)定
- 計日工管理辦法百度文庫
- 證券投資基金管理公司管理辦法
- DB32T 1590-2010 鋼管塑料大棚(單體)通 用技術要求
- 阿片類藥物不良反應綜合防治專家共識(2024年版)
- 農(nóng)村訂單定向醫(yī)學??疲ǜ呗殻┥囵B(yǎng)定向就業(yè)協(xié)議書
- 對賬單標準格式模板
- 2025年中考物理一輪復習資料配套練習專題02 光現(xiàn)象(測試)(含答案)
- 瞳孔觀察方法與技巧
- 《經(jīng)濟法學》(第三版)電子教案
- DB4116-T 059-2024 智慧消防運維服務規(guī)范
- 消防應急預案電子版
- GB/T 44353.2-2024動物源醫(yī)療器械第2部分:來源、收集與處置的控制
- 生活垃圾衛(wèi)生填埋場運行管理方案
評論
0/150
提交評論