写出一个程序,接受一个有字母和数字以及空格组成的字符串,和一个字符,然后输出输入字符串中含有该字符的个数。不区分大小写。
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
String str = "";
Scanner sc=new Scanner(System.in);
while((str=stdin.readLine())!=null)
{
String word = sc.next();
char ch[] = str.toUpperCase().toCharArray();
word = word.toUpperCase();
int count=0;
for(int i=0;i<ch.length;i++)
{
if(ch[i] == word.charAt(0))
{
count++;
}
}
System.out.println(count);
}
请问哪里出现数组越界错误