首页 试题详情
单选题

下列程序的功能是统计字符串中"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");   } }

B=

D>=

正确答案:A (备注:此答案有误)

相似试题

  • 单选题

    下列程序功能统计字符串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

    答案解析

热门题库