我在编译这个 java 文件时遇到问题。我无法理解那个问题是什么。日食 说
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
at ll.ln.main(ln.java:11)"
这是目录:
这是代码:
package ll;
public class ln {
public static void main(String arguments[]) {
String[] pharse={"here i am ","ther you are",
"nobody movewho is in charge here",
"haven dosent far away"};
for (int count=0;count<=pharse.length;count ++){
String courenttext=pharse[count];
char[] chcs=courenttext.toCharArray();
int[] ln=new int[26];
for(int i=0;i<=chcs.length;i++){
if((chcs[i]>'z')||(chcs[i]<'a'))
continue;
ln[chcs[i]-'a'] ++;
}
for (int i=0;i<27;i++){
char t='a';
t+=i;
System.out.println(t +": "+ln[i]+" ");
}
}
}
}