Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A、 An exception is thrown at runtime.B、 1C、 4D、 Compilation fails.E、 0
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()
- A、 An exception is thrown at runtime.
- B、 1
- C、 4
- D、 Compilation fails.
- E、 0
相关考题:
当运行以下程序时,输入 abcd ,程序的输出结果是 : 【 9 】 。insert(char str[]){ int i;i=strlen(str);while(i0){ str[2*i]=str[i];str[2*i-1]='*'; i--;}printf(" % s\n",str);}main(){ char str[40];scanf(" % s",str);insert(str);}
下列程序的运行结果为includevoid abc(char*str){int a,b;for(a=b=0;str[a]!='\0';a++ 下列程序的运行结果为 #include<stdio.h> void abc(char*str) { int a,b; for(a=b=0;str[a]!='\0';a++) if(str[a]!='c') str[b++]=str[a]; str[b]='\0';} void main() { char str[]="abcdef"; abc(str); printf("str[])=%s",str);}A.str[]=abdefB.str[]=abcdefC.str[]=aD.str[]=ab
设有定义char str[80];以下不能将输入数据first\nsecond\n读取到数组str中的语句是A.ein.get(str,strlen(str));B.cin.getline(str,strlen(str));C.cin>>str;D.cin.read(str,strlen(str));
下列程序的运行结果为()。 include voidabc(Char*str) {inta,b,i,j; for(i=j=0;str[i]! 下列程序的运行结果为( )。#include<stdio.h>voidabc(Char*str){ inta,b,i,j;for(i=j=0;str[i]!='\0';i++)if(str[i]!='a')str[j++]=str[i];str[j]='\0';}void main(){ char str[]="abcdef";abc(str);printf("str[]=%s",str);}A.str[]=bcdefB.str[]=abcdefC.str[]=aD.str[]=ab
下列程序的运行结果为#includestdio.hvoid abc(char*str){ int a,b;for(a=b=0;str[a]!='\0';a++)if(str[a]!='c')str[b++]=str[a];str[b]='\0';}void main(){ char str[]="abcdef";abc(str);printf("str[]=%s",str); }A.str[]=abdefB.str[]=abcdefC.str[]=aD.str[]=ab
字符串"\\\"ABCDEn"\"\\"的长度是( )。A.strcpy(str2,str1)B.strcpy(str3,str1)C.strcpy(str4,str1)D.strcpy(str5,str1)
设有定义charstr[80]以下不能将输人数据nrst\nsecond\<CR)读取到数组str的语句是( )。A.cin.get(str,strlen(str));B.cin.getline(str,strlen(str));C.cin>>str;D.dn.read(str,strlen(str));
Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()() A.B.C.D.E.F.
以下C程序段的输出结果是(30)。 include void abc(char *str){ int a, b; 以下C程序段的输出结果是(30)。 #include <stdio. h> void abc(char *str){ int a, b; for(a=b=0;str[a]!='\O';a++)if(str[a]!='c') str[b++]=str[a]; str[b]='\O'; } void main(){ char str[]="abcdef"; abc(str); printf("str[]=%s",str); }A.str[]=aB.str[]=abC.str[]=abdefD.str[]=abcdef
Given:11.//insertcodehere12.min.doubleValue())17.min=added;18.if(max==null||added.doubleValue()max.doubleValue())19.max=added;20.}21.}Whichtwo,insertedatline11,willallowthecodetocompile?()
设有char str[80];以下不能将输入数据first\nsecond\n读取到数组str中的语句是A.cin.get(str 设有char str[80];以下不能将输入数据first\nsecond\n<CR>读取到数组str中的语句是A.cin.get(str,strlen(str));B.cin.getline(str,strlen(str));C.cin>>str;D.cin.read(str,strlen(str));
char str[ ]= "Hello";char *p=str;int n=10;sizeof(str)=( )sizeof(p)=( )sizeof(n)=( )void func(char str[100]){ }sizeof(str)=( )
执行下面的程序,单击窗体后在窗体上显示的结果是 ______。Private Sub form_ Click() Dim Str1 As String, Str2 As String Dim Str3 As String, I As Integer Str1 = "e" for I = t To 2 Str2 = Ucase (Str1) Str1 = Str2 Str1 Str3 = Str3 Str1 str1 = Chr (Asc(Str1) + I) Next I Print Str3End SubA.EeFFB.eEfFC.EEFFD.eeFF
下列语句中,正确的是______。A.static char str[]="China";B.static char str[];str="China";C.static char str1[5],str2[]={"China"};strl=str2;D.static char str1[],str2[];str2={"China"};strcpy(str1,str2);
下列描述中,不能正确给字符数组str定义和赋值的是( )。 A、char str[]={"abcdefghijklmn "};B、char str[10];str={" abcdefghijklmn "};C、char str[10]={"abcdefghijklmn"};D、char str[10];strcpy(str,"abcdefghijklmn");
若有下列说明,则( )不是对strcpy库函数的正确的调用。strcpy库函数用于复制一个字符串:char*str1="abcdt",str2 [10],*str3="hijklmn",*str4[2],*str5="aaaa";A.strcpy(str2,str1)B.strcpy(str3,str1)C.strcpy(str4,str1)D.strcpy(str5,str1)
在下列语句中,正确的是( )A.static char str[]="China";B.static char str[];str="China";C.static char str1[5],str2[]={"China"};str1=str2;D.static char str1[],str2[];str2={"China"};strcpy(str1,str2);
当运行以下程序时,输入abcd,程序的输出结果是:( )。insert(char str[]){int i;i=strlen(str);while(i>0){str[2*i]=str[i];str[2*i-1]='*';i--;}printf("%s\n",str);}main(){char str[40];scanf("%s",str);insert(str);}
11. public void testIfA() { 12. if(testIfB(”True”)) { 13. System.out.println(”True”); 14. } else { 15. System.out.println(”Not true”); 16. } 17. } 18. public Boolean testIfB(String str) { 19. return Boolean.valueOf(str); 20. } What is the result when method testIfA is invoked?() A、 TrueB、 Not trueC、 An exception is thrown at runtime.D、 Compilation fails because of an error at line 12.E、 Compilation fails because of an error at line 19.
两个字符串String str1,str2;错误的连接二者的方式是()A、str1+str2B、str1.str2C、str1.contat(str2)D、str2.contat(str1)
Given the following code fragment: 1) String str = null; 2) if ((str != null) (str.length() 10)) { 3) System.out.println("more than 10"); 4) } 5) else if ((str != null) (str.length() 5)) { 6) System.out.println("less than 5"); 7) } 8) else { System.out.println("end"); } Which line will cause error?() A、 line 1B、 line 2C、 line 5D、 line 8
java中 String str = "hello world"下列语句错误的是()。A、str+=’ a’B、int strlen = str.lengthC、str=100D、str=str+100
设已定义:char str1[10],str2[10]=”Fujian”;则能将字符串”Fujian”赋给数组str1的正确语句是()A、str1=”Fujian”B、strcpy(str1,str2)C、strcpy(str2,str1)D、str1=str2
多选题Given: 11. 16. Which three EL expressions, inserted at line 16, are valid and evaluate to "d"?()A${map.c}B${map[c]}C${map[c]}D${map.map.b}E${map[map.b]}
单选题11. public static void test(String str) { 12. if(str == null | str.lellgth() == 0) { 13. System.out.println(”String is empty”); 14. } else { 15. System.out.println(”String is not empty”); 16. } 17. } And the invocation: 31. test(llull); What is the result?()A Au exception is thrown at runtime.B “String is empty” is printed to output.C Compilation fails because of au error in line 12.D “String is not empty” is printed to output.
单选题Given the following code fragment: 1) String str = null; 2) if ((str != null) (str.length() 10)) { 3) System.out.println("more than 10"); 4) } 5) else if ((str != null) (str.length() 5)) { 6) System.out.println("less than 5"); 7) } 8) else { System.out.println("end"); } Which line will cause error?()A line 1B line 2C line 5D line 8