网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

20、对于String s;,以下哪句是对的?

A.s是一个变量,它将要管理一个String的对象

B.s是一个变量,其中有一个String的对象

C.s现在的值是null

D.s是一个变量,它现在正管理着一个String的对象


参考答案和解析
s是一个变量,它将要管理一个String的对象
更多 “20、对于String s;,以下哪句是对的?A.s是一个变量,它将要管理一个String的对象B.s是一个变量,其中有一个String的对象C.s现在的值是nullD.s是一个变量,它现在正管理着一个String的对象” 相关考题
考题 创建字符串s:String s=new String(“abcd”);以下 将改变s。() A.s.append(“x”);B.s.concat(“y”);C.s.substring(3);D.以上语句都不会

考题 若输入bcdefgh、m、abcdefg,以下程序的输出结果为()。includeincludemain(){i 若输入bcdefgh、m、abcdefg,以下程序的输出结果为( )。 #include<stdio.h> #include<string.h> main() { int i; char string[20],str[3][20]; for(i=0;i<3;i++)gets(str[i]); if(strcmp(str[0],str[1])>0) strcpy(string,str[0]); else strcpy(string,str[1]); if(strcmp(str[2],string)>0) strcpy(string,str[2]); printf("%s",string); }A.bcdefghB.mC.abcdefgD.bcdefgh或abcdefg

考题 下面的哪些程序段可能导致错误? ( ) Ⅰ: 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.Ⅲ、Ⅳ

考题 假设有以下代码: String s="hello"; String t="hello"; char c[ ]={'h','e','l','l','o'}; 下列选项中,返回false的语句是______。A.s.equals(t);B.t.equals(c);C.s==t;D.t.equals(new String("hello"));

考题 假定有以下函数过程: Function Fun(S As String) As String Dim sl As String For i=1 To Len(S) s1=UCase (Mid(S,i,1))+s1 Next i Fun=s1 End Function则Str2=Fun("abcdefg”)的输出结果为( )。A.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA

考题 String s=”Example String”; 下面哪些语句是正确的?() A.s>>>=3;B.int i=s.length();C.s[3]=”x”;D.String short_s=s.trim();E.String t=”root”+s;

考题 对于下面的程序includeincludechar *scmp(char*s1,char*s2){if(strcmp(s1, 对于下面的程序 #include<stdio.h> #include<string.h> char *scmp(char*s1,char*s2) { if(strcmp(s1,s2)<0)return(s1); else return(s2); } main() { int i:char string[20],sb[3][20]; for(i=0;i<3;i++)gets(str[i]); strcpy(string,scmp(str[0],str[1])); strcpy(string,scmp(string,str[21)); printf("%s\n",string); } 若运行时依次输入abcd、abba和abc三个字符串,则输出结果为______。A.abcdB.abbaC.abcD.abca

考题 以下程序中函数scmp的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址#include <stdio.h>#include <string.h>char *scmp(char *s1, char *s2){ if(strcmp(s1,s2)0)return(s1);else return(s2);}main( ){ int i; char string[20], str[3][20];for(i=0;i3;i++) gets(str[i]);strcpy(string,scmp(str[0],str[1])); /*库函数strcpy对字符串进行复制*/strcpy(string,scmp(string,str[2]));printf("%s\n",string);}若运行时依次输入:abcd、abba和abc三个字符串,则输出结果为A.abcdB.abbaC.abcD.abca

考题 下列的哪个程序段可能导致错误? ( )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";

考题 以下程序中函数scmp功能是返回形参指针s1和s2所指字符串中较小字符串的首地址。#includ<string. h>char *scmp(char *s1,char *s2){ if(strcmp(s1,s2)<0) return(s1); else return(s2);}main(){ int i;char string[20],str[3][20]; for(i=0;i<3;i++) gets(str[i]); strcpy(string,scmp(str[0],str[1])); //库函数 strcpy 对字符串进行复制 strcpy(string,scmp(stfing,str[2])); puts(string); }若运行时依次输入: abed、abba 和abc三个字符串,则输出结果为( )。A.abedB.abbaC.abcD.abca

考题 以下程序的输出结果是()includemain(){chars1[]="123",s2[]="abc",ss[20]="010";strc 以下程序的输出结果是 ( ) #include<string.h> main() {char s1[]="123",s2[]="abc",ss[20]="010"; strcat(ss+1,strcpy(s2,s1)); printf("%s\n",ss); }A.10123B.0abcC.1123D.01abc

考题 对于下面的程序includeincludechar * scmp(char * s1,char * s2){if(strcm 对于下面的程序 #include<stdio.h> #include<string.h> char * scmp(char * s1,char * s2) { if(strcmp(s1,s2)<0)return(s1); else return(s2); } main() { int i;char string[20],str[3][20]; for(i=0;i<3;i++)gets(str[i]); strcpy(string,scmp(str[0],str[1])); strcpy(string,scmp(string,str[2])); printf("%s\n",string); } 若运行时依次输入abcd、abba和abc三个字符串,则输出结果为 ______。A.abcdB.abbaC.abcD.abca

考题 假定有以下函数过程: Function Fun(S As String)As String Dimsl As String Fori=1 To Len(S) s1=UCase(Mid(S,i,1))+s1 Nexti Fun=s1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl_Click() DimStrl As String,Str2 As StrA.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA

考题 以下4组表达式中结果是逻辑值.T.的是_________。A.'this'$'this is a string'B.'this'$'THIS IS A STRING'C.'this is a string'S'this'D.'this'>'this is a string'

考题 以下程序中函数scmp的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址。 #include<string> char*scmp(char*s1,char*s2) { if(strcmp(s1,s2)<0) return(s1); else retrun(s2); } main() { int i;char string[20],str[3][20]; for(i=0;i<3;i+A.abcdB.abbaC.abcD.abca

考题 创建字符串s:String s=new String("xyzy"):以下( )将改变s。A.s.append("a")B.s.concat("s")C.s.substring(3)D.以上语句都不会

考题 下列的哪个程序段可能导致错误?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";

考题 下面的哪些程序片断可能导致错误() A、String s = "Gone with the wind";  String t = " good ";  String k = s + t;B、String s = "Gone with the wind";  String t;  t = s[3] + "one";C、String s = "Gone with the wind";  String standard = s.toUpperCase();D、String s = "home directory"; String t = s - "directory"

考题 下面哪个是对字符串String的正确定义()。A、String s1=null;B、String s2=’null’;C、String s3=(String)‘abc’;D、String s4=(String)‘/uface’;

考题 以下代码创建几个对象() String s1='bc';String s2='bc'; A、2B、1C、3D、0

考题 下列不是 String 类的方法的是()A、charAt(int index)B、indexOf(String s)C、beginWith(String s)D、endsWith(String s)

考题 有声明语句:delegate void TimeDelegate(string s),则以下语句可以和委托TimeDelegate绑定的方法是()A、 void f(){  }B、 string f(){  }C、 void f(string a){  }D、 string f(string a){  }

考题 有语句String s=”hello world”; ,以下操作哪个是不合法的()A、int i=s.length();B、s=3;C、String ts=s.trim();D、String t=s+”!”

考题 Which of the following fragments might cause errors?()    A、 String s = "Gone with the wind";String t = " good ";String k = s + t;B、 String s = "Gone with the wind";String t;t = s[3] + "one";C、 String s = "Gone with the wind";String standard = s.toUpperCase();D、 String s = "home directory";String t = s - "directory";

考题 单选题有声明语句:delegate void TimeDelegate(string s),则以下语句可以和委托TimeDelegate绑定的方法是()A  void f(){  }B  string f(){  }C  void f(string a){  }D  string f(string a){  }

考题 单选题下列不是 String 类的方法的是()A charAt(int index)B indexOf(String s)C beginWith(String s)D endsWith(String s)

考题 判断题使用String s1=new String("Java");String s2=new String("Java")创建两个字符串时,s1,s2使用不同的内存空间A 对B 错

考题 单选题下面哪个是对字符串String的正确定义()。A String s1=null;B String s2=’null’;C String s3=(String)‘abc’;D String s4=(String)‘/uface’;