更多"[单选题]下列程序的功能是统计字符串中'array'的个数,在程序的空"的相关试题:
[单选题]下列程序的功能是统计字符串中"array"的个数,在程序的空白处应填入的正确选项是:
public class FindKeyWords{
public static void main(sring[] args){
String text=
" An array is a data structur that stores a collection of"
+ "values of the same type . You access each individual value"
+ "through an integer index . For example,if a is an array"
+ "of inergers, then a[i] is the ith integer in the array.";
int arrayCount =0;
int idex = -1;
String arrarStr ="array";
index = text.indexof(arrayStr);
while(index ______ 0) {
++arrayCount;
index += arrayStr.length();
index = text.indexof(arrayStr,index);
}
System.out.println
("the text contains" + arrayCount + "arrays");
}
}
A.<
B.=
C.<=
D.>=
[判断题]字符串的长度是指串中所含字符的个数。
A.正确
B.错误
[单选题]C#语言中,字符串常量@"123\n456"的长度(有效字符个数)是( )。
A.6
B.7
C.8
D.9
[单选题]假定一个字符串的长度为n,则定义存储该字符串的字符数组的长度至少为( )。
A.n-1
B.n
C.n+1
D.n+2
[单选题]字符串“IBM”中的字母B 存放在计算机内占用的二进制位个数是 。( )
A.8
B.4
C.2
D.1
[单选题]在Word中进行替换时,替换字符串的长度( )被替换的字符串。
A.必须小于
B.必须大于
C.不必等于
D.必须等于