将1,2,3,4,5输出到屏幕
将0,1,2,3,4输出到屏幕
将0,1,2,3,4,5输出到屏幕
将出现运行时异常
第1题:
( 27 )有如下程序:
#include <iostream>
using namespace std;
class Toy{
public:
Toy(char* _n) { strcpy (name,_n); count++;}
~Toy(){ count--; }
char* GetName(){ return name; }
static int getCount(){ return count; }
private:
char name[10];
static int count;
};
int Toy::count=0;
int mail(){
Toy t1("Snoopy"),t2("Mickey"),t3("Barbie");
cout<<t1.getCount()<<endl;
return 0;
}
运行时的输出结果是
A ) 1
B ) 2
C ) 3
D )运行时出错

第2题:
阅读下列程序段
int i=3,j;
outer:while(i>0){
j=3;
inner:while(j>0){
if(j<2) break outer;
System.out.println(j+"and"+i);
j--;
}
i--;
}
被输出到屏幕的第一行结果是【 】 。
第3题:
下面程序的正确输出是( )。 Publicclasshello { Publicstaticvoidmain(Stringargs[]) { Intcount,xPos=25; For(count=1;count<=10;count++) { IRcount==5) Break; System.out.println(count); xPos+=10; } } }
A.1 2 34
B.1 34
C.编译错误
D.以上都不正确
第4题:
程序段intcount=0;char*s=”ABCD”;while(*s!=’/0’){s++;count++;}执行后count=()。
4
略
第5题:
int [] my_Array; my_Array = new int[5]; for(int count = 0; count <= 5; count++) System.out.println(my_Array[count]); 结果是()
第6题:
For debugging purposes, you need to record how many times a given JSP is invoked before the user’ssession has been created. The JSP’s destroy method stores this information to a database. Which JSPcode snippet keeps track of this count for the lifetime of the JSP page?()
第7题:
int[]my_Array; my_Array=newint[5]; for(intcount=0;count<=5;count++)System.out.println(my_Array[count]); 以上Java代码运行的结果是()。
第8题:
编译如下Java程序片断: class test{ int count = 9; public void a(){ int count=10; System.out.println("count 1 =" + count); } public void count(){ System.out.println("count 2 =" + count); } public static void main(String args[]){ test t=new test(); t.a(); t.count(); } } 结果将()。
第9题:
比较hello与test文件的内容
将hello这个字符输出到屏幕上
将hello这个字符输出到test文件中
什么都不作
第10题:
第11题:
对
错
第12题:
将1,2,3,4,5输出到屏幕
将0,1,2,3,4输出到屏幕
将0,1,2,3,4,5输出到屏幕
将出现运行时异常
第13题:
( 9 )阅读下列程序段
int i=3 , j ;
outer:while ( i>0 ){
J=3;
inner:while ( j>0 ){
if ( j<2 ) break outer;
System.out.println ( j+"and"+i ) ;
j-- ;
}
i--;
}
被输出到屏幕的第一行结果是 【 9 】
第14题:
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++;%>
第15题:
给出下列代码段: int i=3,j; outer:while(i>0) { j=3; inner:while(j>0) { if(j<3) break outer; System.out.println(j+"and"+i); j--; } i--; }下列选项中( )会被输出到屏幕。
A.3 and 3
B.3 and 2
C.3 and 1
D. 3 and 0
第16题:
int [] my_Array; My_Array=new int [5]; For(int count = 0 ; count <=5; count ++) System.out.pringtln(my_Array[count]); 以上Java代码运行的结果是()
第17题:
You need to create a JSP that generates some JavaScript code to populate an array of strings used on theclient-side. Which JSP code snippet will create this array?()
第18题:
在linux下echohello>test这条命令中”>”符号的作用是()。
第19题:
屏幕显示是指将各种报表输出到屏幕上,报表使用者可以通过屏幕查看报表。()
第20题:
MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;} %>
MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { . MY_ARRAY[${i}] = ’${serverArray[i]}’;. } %>
MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;. <% } %>
MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[${i}] = ’${serverArray[i]}’;. <% } %>
第21题:
不能通过编译
输出: count 1 = 10 count 2 = 9
输出: count 1 = 9 count 2 = 9
第22题:
将1,2,3,4,5输出到屏幕
将0,1,2,3,4输出到屏幕
将0,1,2,3,4,5输出到屏幕
将出现运行时异常
第23题:
<%! int count = 0; %><% if ( request.getSession(false) == null ) count++; %>
<%@ int count = 0; %>. <% if ( request.getSession(false) == null ) count++; %>
<% int count = 0;. if ( request.getSession(false) == null ) count++; %>
<%@ int count = 0;. if ( request.getSession(false) == null ) count++; %>
<%! int count = 0;. if ( request.getSession(false) == null ) count++; %>