还剩6页未读,继续阅读
文本内容:
杭州天丽科技有限企业高级程序员JAVA选择题1:
1.What will be theresult ofexecuting the following code
2.boolean a=true;
3.boolean b=false;
4.boolean c=true;
5.if a==true
6.if b==true
7.if c==true System.out.printlnHSome thingsare true in this world;
8.else System.out.println,Nothing is truein thisworld!n;
9.else ifab=c System.out.printlnHlts tooconfusing totell whatistrueand what isfalse;
10.else System.out.printlnfHey this wont compile;
11.
12.Choices:A.The codewon*t compileB/Some thingsare trueinthisworld willbe printedCJHeythiswon*t compile**willbeprintedD.None of these2:Which ofthe followingstatements aretrueA.The automaticgarbage collectionoftheJVM preventsprograms fromever runningout ofmemoryB.A programcan suggestthat garbagecollection beperformed andforce itC.Garbage collectionis platformindependentD.An objectbecomes eligiblefor garbagecollection whenall referencesdenoting itare settonull.3:
1.What willhappen whenyou attemptto compileand runthe followingcode
2.
3.class Base
5.
6.
7.int i=99;
8.
10.
11.{
12.
13.System.out.printlnBase.amethodn;
14.
15.
16.
17.Base
18.
19.{
20.
21.amethod;
22.
23.
24.
25.}
26.
9.public voidamethod
27.public classDerived extendsBase
28.
29.{
30.』
31..int-1;
32.
33.
34.
35.public staticvoid mainStringargv[]
36.
37.{
38.
39.Base b=new Derived;
40.
41.System.out.printlnb.i;
42.
43.b.amethod;
44.
45.
46.
47.public voidamethod
48.
49.{
50.
51.System.out.printlnDerived.amethod;
52.
53.}
54.
55.}
56.
57.Choices:A.Derived.amethod-1Derived.amethodB.Derived.amethod99C.Compile timeerrorD.Derived.amethod4:A classdesign requiresthat amember variableshould beaccessible onlyby samepackage,which modiferword shouldbe usedA.protectedB.publicC.no modifer
0.private5:假定和为型变量,则执行下述语句组后,的值为a bint ba=1;b=10;dob-=a;a++;}while b-0;A.9b.-2r C.-1D.86:
1.What resultsfrom attemptingto compileand runthe followingcode
2.
3.public classTernary
4.
5.
6.
7.public staticvoid mainStringargs[]
8.
9.{
10.11,inta=5;
12.
13.System.out.println,Value is-+a
59.9:9;
14.
15.}
16.
17.}
18.
19.Choices:A.prints:Value is-9B.Compilation errorC.prints:Value is-5D.None ofthese
1.String s=,,Example Stringn;Which operationis notlegalA.int i=s.length;;B.s
[3]=xC.String short_s=s.trim;仁
0.String root”+s;8:Consider theclass hierarchyshown below:class FourWheelerimplements DrivingutilitiesclassCar extends FourWheelerclass TruckextendsFourWheelerclassBus extendsFourWheelerclass Craneextends FourWheelerConsiderthefollowingcode below:
1.Drivingutilities du;
2.FourWheeler fw;
3.Truck myTruck=new Truck;
4.du=DrivinglltilitiesmyTruck;
5.fw=new Crane;
6.fw=du;Which ofthe statementsbelow aretrueChoices:A.Line4will notcompile becausean interfacecannot referto anobject.B.The codewill compileand run.C.The codewill notcompile withoutan explicit cast at line6,because goingdown thehierarchywithout castingis notallowed.D.The codewill compileif weput anexplicitcastatline6but willthrow anexception atruntime.9:
1.Give thefollowing javaclass:
2.public classExample{
3.static intx[]=new int
[15];
4.public staticvoid mainStringargs[]{
5.System.out.printlnx
[5];
6.}
7.}
8.Which statementis corrected川A.When compile,some errorw occur.B.When run,some errorwill occur.C.Output iszero.
0.Output isnull.10:
1.Give thecode fragment:
2.ifx4{
3.System.out.printlnfTest1;}
4.else ifx9{
5.System.out.printlnuTest2;}
6.else{
7.System.out.printlnuTest3;}?
8.Which rangeof valuex wouldproduce ofoutput UTest2”A.x4B.x4C.x9D.None11:Use theoperator»n and”.Which statementis trueA.10100000000000000000000000000000»4give00001010000000000000000000000000B.10100000000000000000000000000000»4give11111010000000000000C.10100000000000000000000000000000»4give00000000000000000000000000000000D.10100000000000000000000000000000»4give11111010000000000000000012:使用可以做到的是00000000JDBC.把二进制代码传送到任何关系数据库中A把源代码传送到任何关系数据库中B.Java把表单信息传送到任何关系数据库中C.很轻易地把语句传送到任何关系数据库中D.SQL等於多少?13:Math.round-
11.5A.-11B.-12D.none14:软件生命周期的瀑布模型把软件项目分为个阶段、个子阶段,如下哪一种是正常的开发次序?38计划阶段、开发阶段、运行阶段A..设计阶段、开发阶段、编码阶段B设计阶段、编码阶段、维护阶段C.计划阶段、编码阶段、测试阶段D.简答题15:找到一种子字符串,优化速度,优化空间16:什么是接口?为何要定义接口?接口与抽象类有何异同?17:下面的代码在绝大部分时间内都运行得很正常,请问在什么状况下会出现问题?问题的本源在哪里?import java.util.LinkedList;LinkedList list=new LinkedList;public synchronizedvoid pushObjectx{synchronizedlist{list.addLast x;notify;public synchronizedObject popthrows Exception{synchronizedlist{if list.size=0{wait;return list.removeLast;的接口和的虚类的相似和不一样处18:Java C++中区另19:hibernate load/get U20:How doyou useJMX tomonitor thecluster ifyou haveused中异常处理有什么长处?21Java中用来编译页面的是哪个类,或者哪个模块?22:tomcat JSP的作用?为何要用?23:Class.forName有哪些动作?作用分别是什么?24:jsp写一种程序,把一种以内的自然数分解因数自然数分解因数就是将一种自然数分解为几25:100种素数的乘积,提醒,由于该数不是很大,因此可以将质数保留在数组中,以加紧计算速度。
个人认证
优秀文档
获得点赞 0