A. 900 seconds
B. 1200 seconds
C. 3000 seconds
D. 65535 seconds
第1题:
A.assertvalue==null;
B.assertvalue!null,“valueisnull”;
C.if(value==null){thrownewAssertionException(”valueisnull”);
D.if(value==null){thrownewIllegalArgumentException(”valueisnull”);
第2题:
publicclassSwitchTest{publicstaticvoidmain(String[]args){System.out.println(value=+switchIt(4));}publicstaticintswitchIt(intx){intj=1;switch(x){case1:j++;case2:j++;case3:j++;case4:j++;case5:j++;default:j++;}returnj+x;}}Whatistheresult?()
A.value=3
B.value=4
C.value=5
D.value=6
E.value=7
F.value=8
第3题:
第4题:
1.publicclassSwitchTest{2.publicstaticvoidmain(String[]args){3.System.out.PrintIn(value=”+switchIt(4));4.}5.publicstaticintswitchIt(intx){6.intj=1;7.switch(x){8.case1:j++;9.case2:j++;10.case3:j++;11.case4:j++;12.case5:j++;13.default:j++;14.}15.returnj+x;16.}17.}Whatistheoutputfromline3?()
A.Value=3
B.Value=4
C.Value=5
D.Value=6
E.Value=7
F.Value=8
第5题:
publicclassSwitchTest{publicstaticvoidmain(Stringargs){System.out.PrintIn(value=”+switchIt(4));}publicstaticintswitchIt(intx){intj=1;switch(x){case1:j++;case2:j++;case3:j++;case4:j++;case5:j++;default:j++;}returnj+x;}}Whatistheoutputfromline3?()
A.Value=3
B.Value=4
C.Value=5
D.Value=6
E.Value=7
F.Value=8
第6题:
1、针对下列程序段,需要()个测试用例才可以满足语句覆盖的要求。 switch (value ) { case 0: other = 30; break; case 1: other = 50; break; case 2: other = 300; case 3: other = other/value; break; default: other = other * value; }
A.2
B.3
C.4
D.5