下列程序:
import java.io.*;
public class Abc {
public static void main(String[] args) throws IOException {
byte str[]=new byte[20];
byte bt[]=new byte[2];
System.out.println("请输入一组字符...");
System.in.read(str) ;
System.out.println("请输入要统计的字符...");
System.in.read(bt);
int i;
int count=0;
for(i=0;i<=str.length;i++){
if(bt.equals(str[i]))
count++;
}
System.out.println("字符"+bt+"在字符串中出现的次数为:"+count);
}
}
请问:问题出在哪了?