二级二级JAVA2013年全国计算机等级考试二级JAVA上机临考冲刺试卷(1)
题目内容

下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是(  )。public class FindKeyWords(public static void main(sring[]args){sting text="An array is a data structur that stores a eollection of"+"values of the same type.You access each individu-al value"+"through an integer index.For example.if a is anarray"+"of inergers,then all]is the ith integer in the ar-ray.";Int arrayCount=0;Int idex=-l;Sting arrarStr="array":Index=text.indexof(arrayStr);While(index 0){++arrayCount:Index+=arrayStr.1ength();Index=text.indexof(arrayStr,index);}System.OUt.println("the text contains"+arrayCount+"arrays");}}

2024-07-09

A.<

B.=

C.<=

D.>=

题目答案

试卷相关题目

最新试卷
热门试卷

长理培训客户端 资讯,试题,视频一手掌握

去 App Store 免费下载 iOS 客户端