欢迎来到天天文库
浏览记录
ID:34613222
大小:47.00 KB
页数:6页
时间:2019-03-08
《java练习题附标准答案answerstopratise5》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、一、MultipleChoice1.Javaisanobject-orientedprogramminglanguage.Anobject-orientedlanguage:(a)Usesstructuredprogramming.(b)Viewsaprogramasconsistingofobjectswhichcommunicatethroughinteractions.(c)Functionallybreaksdownproblemsintosmaller,moremanageableproblems.(d)Alloftheabove.2.InJava,th
2、eequalsignisusedasthe___________operator.(a)increment(b)decrement(c)assignment(d)negation矚慫润厲钐瘗睞枥庑赖。3.InJava,sourcecodeiscompiledintoobjectcodecalled______________.(a)Bit-code(b)Classcode(c)Methodcode(d)Byte-code聞創沟燴鐺險爱氇谴净。4.IdentifytheinvalidJavaidentifier.(a)1Week(b)Week1(c)amountDu
3、e(d)amount_due残骛楼諍锩瀨濟溆塹籟。5.Whichoperatorisusedtoconcatenatetwostrings?(a)+(b)–(c)*(d)/酽锕极額閉镇桧猪訣锥。6.Whichstatementorgroupofstatementsproducestheoutput:“Java”,I’mcoming!(a)System.out.print(“Java”,I’mcoming!)(b)System.out.println(““Java””,I’mcoming!);(c)System.out.println(““Java”,I’mc
4、oming!”);(d)System.out.print(““Java”,I’mcoming!”);彈贸摄尔霁毙攬砖卤庑。7.Whenthenumberofrepetitionsareunknowninadvance,youshouldusea___________statement.(a)whileordo…while(b)onlywhile(c)for(d)Noneoftheabove謀荞抟箧飆鐸怼类蒋薔。8.Amethodthatperformssomeactionotherthanreturningavalueiscalleda__________meth
5、od.(a)null(b)void(c)public(d)private厦礴恳蹒骈時盡继價骚。9.Avariablewhosemeaningisconfinedtoamethoddefinitioniscalled:(a)instancevariable(b)localvariable(c)globalvariable(d)noneoftheabove茕桢广鳓鯡选块网羈泪。10.InJava,acommentsblockisdelimitedby:(a)()(b)/**/(c)““(d){}鹅娅尽損鹌惨歷茏鴛賴。1.InJava,call-by-valueison
6、lyusedwith:(a)objects(b)primitivetypes(c)this(d)alloftheabove籟丛妈羥为贍偾蛏练淨。2.TwomethodsthatareexpectedtobeinallJavaclassesare:(a)getNameandsetName(b)toStringandequals(c)compareToandcharAt(d)toLowerCaseandtoUpperCase預頌圣鉉儐歲龈讶骅籴。3.AllofthesearemethodsofJava’sMathclassexcept:(a)pow(b)min(c)r
7、andom(d)toString渗釤呛俨匀谔鱉调硯錦。4.nullcanbeused:(a)toindicateavariablehasnorealvalue(b)inaBooleanexpressionwith==(c)asaplaceholder(d)alloftheabove铙誅卧泻噦圣骋贶頂廡。5.Astaticmethodisonethatcanbeusedwitha_____________.(a)instancevariable(b)localvariable(c)globalvariable(d)theclassnameasacallingobje
8、ct擁締凤
此文档下载收益归作者所有