下列的( )程序段可能导致错误。
A.String s="hello": Sting t="good"; String k=s+t;
B.Sting s="hello"; String t; t=s [3] + "one";
C.Sting s="hello"; String standard=s.toUpperCase( );
D.String s="hello": Stringt s +"good";
第1题:
下列语句中错误的是
A.String s[]={"how","are"};
B.byte b=255;
C.String s="one"+"two";
D.int i=2+2000;
第2题:
已知String str=new String ("Luck");,则下列关于str的操作中不合法的是( )。
A.String s=str. toUpperCase()
B.int i=Str. length;
C.char s=str. charAt(2);
D.String s="Good" +str;
第3题:
以下程序是计算1 - 1/2 + 1/3 - 1/4 + … + 1/9 - 1/10 的值并输出,请补充完整。
S=0
K=1
T=1
DO WHINE K<【 】
S=S+T/K
K=K+1
T= -T
LOOP
MSGBOX S
第4题:
下列的哪个程序段可能导致错误? ( )
A.String s="hello"; String t="good"; String k=s+t;
B.String s="hello"; String t; t=s[3]+"one";
C.String s="hello"; String standard=s.toUpperCase();
D.String s="hello"; String t=s+"good";
第5题:
下列哪个程序段可能导致错误?
A.String s="hello"; String t= "good"; String k=s+ t;
B.String s="hello"; String t; t=s[3]+"one";
C.String s="hello"; String standard=s. toUpperCase
D.String s="hello"; String t =s+ "good"
第6题:
下面的哪些程序段可能导致错误? ( ) Ⅰ:String s="Gone with the wind"; String t="good"; String k=s+t; Ⅱ:String s="Gone with the wind"; String t; t=s[3]+"one"; Ⅲ:String s="Gone with the wind"; String standard=s.toUpperCase(); Ⅳ:String s="home directory"; String t=s-"directory";
A.Ⅱ、Ⅲ
B.Ⅱ、Ⅳ
C.Ⅰ、Ⅳ
D.Ⅲ、Ⅳ
第7题:
给出下列的代码则以下哪个选项返回true? String s = "hello" ; String s = "hello" ; char c[] = { 'h' ,'e','l','o'};
A.s.equals(t);
B.t.equals(c);
C.s = =t
D.t = = c;
第8题:
给出下面程序: public class ex51 { public static void main(String[] args) { String s = "hello"; String t = "hello"; char c[] = {'h', 'e', '1', '1', 'o'}; System. out. println (______) } } 在程序的横线处填入下列______选项后,程序输出的结果是true。
A.t.equals(c)
B.s.equals?
C.s == t
D.t == c
第9题:
下面哪段语法执行正确()
第10题:
Which of the following fragments might cause errors?()
第11题:
String s = Gone with the wind;String t = good ;String k = s + t;
String s = Gone with the wind;String t; t = s[3] + one;
String s = Gone with the wind;String standard = s.toUpperCase();
String s = home directory;String t = s - directory;
第12题:
String s = Gone with the wind; String t = good ; String k = s + t;
String s = Gone with the wind; String t; t = s[3] + one;
String s = Gone with the wind; String standard = s.toUpperCase();
String s = home directory; String t = s - directory
第13题:
给出下面的代码,则以下( )选项返回true。 String s="hello"; String t="hello"; Char c[]={'h','e','l','l','o'};
A.s. equals (t) ;
B.t. equals (C);
C.s==t;
D.t==c;
第14题:
有以下程序:#include <string .h>void f(char *s, char *t){ char k; k=*s; *s=*t; *t=k; s++; t- -; if(*s) f(s, t);}main(){ char str[10]="abcdefg",*p; p=str+strlen(str)/2+ 1; f(p,p-2); printf("%s\n", str);}程序运行后的输出结果是( )。
A.abcdcfg
B.gfedcba
C.gbcdefa
D.abedcfg
第15题:
有以下程序: #include<string.h> void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++; t--; if(*s) f(s,t); } main( ) {char str[10]="abcdefg",*p; p=str+strlen(str)/2+1; f(p,p-2); printf(~%s\n",str); } 程序运行后的输出结果是 ______。
A.abcdef
B.gfedcba
C.gbcdefa
D.abedcfg
第16题:
有以下程序: #include<string.h> void f(char *s,char *t) {char k; k=*s; +s=*t; *t=k; S++; t--; if(*s) f(s,t); } main() {char.str[10]="abcdefg",*p; p=str+strlen(str) /2+1; f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是 ______。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第17题:
给出下列的代码,则以下哪个选项返回true? String s="hello"; String t="hello"; char c []= {'h','e','1','1','o'};A)s.equals(t);
A.t. equals(
B.;
C.s==t;
D.t==c;
第18题:
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第19题:
下列的哪个程序段可能导致错误?
A.String s = "hello"; String t = "good"; String k = s + t;
B.String s = "hello"; String t; t = s[3] + "one";
C.String s = " hello "; String standard = s.toUpperCase( );
D.String s = "hello"; String t = s + "good";
第20题:
下面的哪些程序片断可能导致错误()
第21题:
String s= "hello"; String t = "hello"; char c[] = {’h’,’e’,’l’,’l’,’o’} ; Which return true?()
第22题:
s.equals(t);
t.equals(c);
s==t;
t.equals(new String(hello));
t==c;
第23题:
String s = Gone with the wind;String t = good ;String k = s + t;
String s = Gone with the wind;String t;t = s[3] + one;
String s = Gone with the wind;String standard = s.toUpperCase();
String s = home directory;String t = s - directory;