[单选题]

下面程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是 public class FindKeyWords{ public static void main(String[]args) { String text="An array is a data structur that stores a collection of" +"values of the same type. You access each indMdual 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 index=-1; String arrayStr="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.>=

参考答案与解析:

相关试题

下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项

[单选题]下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是( )。 publicclassFindKeyWords{ publicstaticvoidmain(sring[]args){ stingtext= “Anarrayisadatastructurthatstoresacollectionof” +“valuesofthesametype.YOUaccesseachindividualvalue'’ +“throughanintegerindex.Forexam

  • 查看答案
  • 下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是(  )。<br />publicclassFindKeyWords<img border=&quo

    [单选题]下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是(  )。publicclassFindKeyWordspublic

  • 查看答案
  • 下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是(  )。<br />图片第二行有误,应为: publicstaticvoidmain(String[]a

    [单选题]下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是(  )。图片第二行有误,应为: publicstaticvoidm

  • 查看答案
  • ( 30 )下列程序的功能是统计字符串中 “ array ” 的个数,在程序的空

    [单选题]( 30 )下列程序的功能是统计字符串中 “ array ” 的个数,在程序的空白处应填入的正确选项是public class FindKey Word s{public static void main(sring[] args){sting text=“ An array is a data structur that stores a collection of ”+ “ values of the same type . You access each individual value

  • 查看答案
  • (8)下列这个Sub过程的功能是统计字符串中“a”的个数,请在空白处填上合适的代

    [主观题](8)下列这个Sub过程的功能是统计字符串中“a”的个数,请在空白处填上合适的代码,将程序补充完整。Private Sub numCount() Dim num As Integer s$="software And hardware" Num=Len(s$) For i=1 unm b$=。 If b$="a"Then x=x+1 Next i Print"x=";xEnd Sub

  • 查看答案
  • 在下面程序的空白处,应填入的正确选项是import java.io.*;publ

    [单选题]在下面程序的空白处,应填入的正确选项是 import java.io.*; public class ObjectStreamTest { public static void main(String args[])throws IOExeeption } ObjectoutputStream os=new ObjectOutputStream(new FileOutputStream("serial.bin")); java.util.Date d=new java.util.Date()

  • 查看答案
  • 在下面程序的空白处,应填入的正确选项是import java.io.*;publ

    [单选题]在下面程序的空白处,应填入的正确选项是 import java.io.*; public class writeInt { public static void main(String[]a) { int[] myArray={10,20,30,40}; try{ DataoutputStream dos=new DataoutputStream(new FileOutputStream("ints.dat")); for(int i=0;i<myArray.length;i++)dos.w

  • 查看答案
  • 下面程序的功能是统计字符串中"i"的个数,请填空。 Sub COU( ) Dim

    [主观题]下面程序的功能是统计字符串中"i"的个数,请填空。Sub COU( )D.im n As Integera$=" Beijing University of Technology"n=Len(a$)F.or i=1 To nb$=[ ]If b$="i" Then x=x+1NextPrint"x=" ; xE.nd Sub

  • 查看答案
  • 下面程序的功能是统计字符串中"i"的个数,请填空。 SubCOU() a$="B

    [主观题]下面程序的功能是统计字符串中"i"的个数,请填空。Sub COU()a$="Beijing University of Technology"D.im n As Integern=Len(a$)F.or i=1 To nb$= (12)If (13) Then x=x + 1Next iPrint "x="; xE.nd Sub

  • 查看答案
  • 下列程序的功能是将字符串“abcde”逆序打印出来。请填写空白处以完善程序。 M

    [主观题]下列程序的功能是将字符串“abcde”逆序打印出来。请填写空白处以完善程序。 Munction rev(str1)As String B = Mid(,1,1) If B =""Then rev ="" Else rev = rev(Mid(str1,2))+b End If End Function Private Sub Form_Click() old ="abcde" Print rev(old) End Sub

  • 查看答案