网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
对如下JSP 代码说法正确的是()。 <% Sring str = ”Hello.JBIT!”; session.setAttribute(“msg’,str); String getStr = session.getAttribute(“msg”); out.println(getStr); %>
- A、 运行成功,页面上输出Hello.JBIT;
- B、 运行成功,页面上输出msg;
- C、 代码行session.setAttribute(“msg’,str);有错误,无法运行
- D、 代码行String getStr = session.getAttribute(“msg”);有错误,无法运行
参考答案
更多 “ 对如下JSP 代码说法正确的是()。 % Sring str = ”Hello.JBIT!”; session.setAttribute(“msg’,str); String getStr = session.getAttribute(“msg”); out.println(getStr); % A、 运行成功,页面上输出Hello.JBIT; B、 运行成功,页面上输出msg; C、 代码行session.setAttribute(“msg’,str);有错误,无法运行 D、 代码行String getStr = session.getAttribute(“msg”);有错误,无法运行” 相关考题
考题
在窗体上有一个命令按钮,然后编如下事件过程:Function SR(x As Double) As DoubleSelect Case Sgn(x)Case 1SR=Sqr(x)Exit FunctionCase 0SR=0Case -1SR=-1End SelectEnd FunctionPrivate Sub Command1_Click()Dim Msg, SRNDim N As DoubleN=InputBox("请输入要计算平方根的数")Msg=N "的平方根"Select Case SR(N)Case 0Msg=Msg "是0"Case -1Msg=Msg "是一个虚数"Case ElseMsg=Msg "是" SR(N)End SelectMsgBox MsgEnd Sub程序运行后,单击命令按钮,在输入对话框内输入-1,输出结果是 【15】 。
考题
假设有如下事件过程:Private Sub Command1_Click()msg1$="Are You Continue to?"msg2$="Open The Books"r=MsgBox(msg1$,34,msg2$)End Sub运行该程序后,所出现的对话框的标题是【 】。
考题
有以下程序: includemain(){ char str[][20]={"Hello","Beijing"},*p=str;printf("%
有以下程序: # include<string.h> main() { char str[][20]={"Hello","Beijing"},*p=str; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是 ______。A.0B.5C.7D.20
考题
您编写下面的代码段,调用函数从 Win32 应用程序编程接口 (API),使用平台调用。string personName = N?el;string msg = welcome + personName + to club!;bool rc = User32API.MessageBox(0, msg, personName, 0);您需要定义一个方法原型可以最佳封送字符串数据。您应该使用哪个代码段?()A.B.C.D.
考题
你写如下的代码去调用Win32 应用程序接口(API)通过使用平台援引:string personName = N?el;string msg = welcome + personName + to club!; bool rc = User32API.MessageBox(0, msg, personName, 0);为了实现上面的调用,你需要定义一个能更好的整理字符串数据的方法原型,请问,你会采用个代码段?()A.B.C.D.
考题
下面代码的运行结果是( )。 public class ConcatTest { public static void main (String[ ] args) { String str1 = "abc"; String str2 = "ABC"; String str3 = str1. coneat(str2); System. out. println(str3); } }A.abcB.ABCC.abcABCD.ABCabc
考题
在窗体中添加一个名称为C1的命令按钮,然后编写如下事件代码: Private Sub C1_Click() str=“ABAABAAABABBA” For i=6 To 2 Step-2 x=Mid(str,i,i) y=Left(str,,i) z=Right(str,i) Next i Msg Box xyz End Sub 单击命令按钮,则消息框的输出结果是( )。A.ABBAABB.ABBABAC.BABABAD.BAABBA
考题
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为includeincludeinc
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include<stdio.h> #include<ctype.h> #include<string.h> int fun(char*str) { int i,j=0; for(i=0;str[i]!='\0';i++) if(str[i]!='')str[j++]=str[i]; str[j]='\0'; } main() { char str[81]; int n; clrscr(); printf("Input a string:"); gets(str); puts(str); fun(str); printf("%s\n",str); }A.asdafaaz67B.asdafaaz67C.asdD.z67
考题
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为includeincludeine
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #inelude <string.h> int fun(char *str) { int i,j=0; for(i=0;str[i]!='\0';i++) if(str[i]!='')str[j++]=str[i]; str[j]='\0'; } main() { char str[81]; int n; printf("Input a string:"); gets(str); puts(str); fun(str); printf("%s\n",str); }A.asdafaaz67B.asd af aa z67C.asdD.z67
考题
阅读下列程序,当运行程序时,输入asd af aa z67,则输出为()。includeint fun (char *str
阅读下列程序,当运行程序时,输入asd af aa z67,则输出为( )。 #include <sldio.h> int fun (char *str) { int i,j=0; for(i=0;str[i]! ='\0';i++) if(str[i]! =") str[j++]=str[i]; str[j]='\0'; } main() { char str[81]; int n; printf("Input a string:"); gets(str); fun(str); printf("%s\n",str); }A.asdafaaz67B.asd af aa z67C.asdD.z67
考题
有以下程序:includemain(){char str[][20]={"Hello","beijing"},*p=str;ptintf("%\n"
有以下程序: #include <string.h> main() { char str[][20]={"Hello","beijing"},*p=str; ptintf("%\n",strlen(p+20)); } 程序运行后的输出结果是( )。A.0B.5C.7D.20
考题
在网页中执行以下JavaScript代码:var str = "www.bjsxt.com";str.title = "北京尚学堂";alert(str.substring(4));该代码在网页中输出的内容是( )
A.空B.程序报错C.www.D.bjsxt.com
考题
如下程序定义了“单词”类word,类中重载了运算符,用于比较“单词”的大小,返回相应的逻辑值。程序的输出结果为:After Sorting:Happy Welcome,请将程序补充完整。includeiostreamincludestringusing namespace std;class Word{public:Word(string s):str(s){}string getStr(){retum str;}【 】const{retum(strw.str);}friend ostreamoperator(ostreamoutput,const W0rdw){outputw.str;return output;}private:string str:};int main(){Word wl(”Happy”),w2(“Welcome”);eout”After sorting:”:if(w1w2)toutwl‘ ’w2:else coutw2‘ ’wl:return 0;}
考题
在某个JSP页面中存在这样一行代码,%= “2” + “4” % 运行该JSP后,以下说法正确的是()。A、这行代码没有对应的输出B、这行代码对应的输出时6C、这行代码对应的输出时24D、这行代码将引发错误
考题
预测以下代码片段的输出结果:() var str ; alert(typeof str);A、. string ;B、. undefined;C、. object ;D、. String;
考题
Which method implementations will write the given string to a file named "file", using UTF8 encoding?() IMPLEMENTATION a: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.write(msg); fw.close(); } IMPLEMENTATION b: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("file"), "UTF8"); osw.write(msg); osw.close(); } IMPLEMENTATION c: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.setEncoding("UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION d: public void write(String msg) throws IOException { FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION e: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new OutputStream(new File("file")), "UTF8" ); osw.write(msg); osw.close(); } A、Implementation a.B、Implementation b.C、Implementation c.D、Implementation d.E、Implementation e.
考题
单选题对如下JSP 代码说法正确的是()。A
运行成功,页面上输出Hello.JBIT; B
运行成功,页面上输出msg; C
代码行session.setAttribute(“msg’,str);有错误,无法运行 D
代码行String getStr = session.getAttribute(“msg”);有错误,无法运行
考题
单选题Which method implementations will write the given string to a file named "file", using UTF8 encoding?() IMPLEMENTATION a: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.write(msg); fw.close(); } IMPLEMENTATION b: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("file"), "UTF8"); osw.write(msg); osw.close(); } IMPLEMENTATION c: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.setEncoding("UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION d: public void write(String msg) throws IOException { FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION e: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new OutputStream(new File("file")), "UTF8" ); osw.write(msg); osw.close(); }A
Implementation a.B
Implementation b.C
Implementation c.D
Implementation d.E
Implementation e.
考题
单选题有如下程序:#include int disp(char *str){ while(*str) putchar(*str++); return *str;}main(){ printf(%d,disp(NAME));}程序运行后的输出结果是( )。A
NAME0B
NAMEEC
NAMED
NAME\0
考题
单选题预测以下代码片段的输出结果:() var str ; alert(typeof str);A
. string ;B
. undefined;C
. object ;D
. String;
热门标签
最新试卷