A.将1,2,3,4,5输出到屏幕
B.将0,1,2,3,4输出到屏幕
C.将0,1,2,3,4,5输出到屏幕
D.将出现运行时异常
第1题:
Fordebuggingpurposes,youneedtorecordhowmanytimesagivenJSPisinvokedbeforetheuser’ssessionhasbeencreated.TheJSP’sdestroymethodstoresthisinformationtoadatabase.WhichJSPcodesnippetkeepstrackofthiscountforthelifetimeoftheJSPpage?()
A.<%!intcount=0;%><%if(request.getSession(false)==null)count++;%>
B.<%@intcount=0;%>.<%if(request.getSession(false)==null)count++;%>
C.<%intcount=0;.if(request.getSession(false)==null)count++;%>
D.<%@intcount=0;.if(request.getSession(false)==null)count++;%>
E.<%!intcount=0;.if(request.getSession(false)==null)count++;%>
第2题:
读以下程序得到运行结果是______ #include<stdio.h> int main() { int k[30]={12,324,45,6}; int count=0,i=0; while(k[i]) { if(k[i]%2==0 || k[i]%5==0) count++; i++; } printf("%d,%dn",count,i); }
第3题:
39、给定如下Java代码片段,编译运行时,结果是() int [ ] a = {1,2,3,4,5}; for (int count = 0 ; count<5; count++) System.out.print(a[count++]) ;
A.运行时出现异常
B.输出:12345
C.输出:24
D.输出:135
第4题:
下面程序的正确输出是( )。 public class Hello { public static void main(String args[]) { int count,xPos=25; for(count=1;count<=10;count++) { if(count= =5) Break; system.Out.println(count); xPos+=10: } } }
A.1 2 3 4
B.1 3 4
C.编译错误
D.以上都不正确
第5题:
给定如下Java代码片段,编译运行时,结果是() int [ ] a = {1,2,3,4,5}; for (int count = 0 ; count<5; count++) System.out.print(a[count++]) ;
A.运行时出现异常
B.输出:12345
C.输出:135
D.输出:24