数组索引超出范围 [英] Array Index Out Of Bounds

查看:100
本文介绍了数组索引超出范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对ArrayIndexOutOfBoundsException有问题,我不知道如何解决!

I have problem with ArrayIndexOutOfBoundsException and I don''t know how to solve it!!!

converted[0][0]=converted[0][0]+dfa[0][0];
for(int i=0;i<100 && i<converted[i].length ;i++){
LandaTrance();
for(int r=0;r<27 && Alpha[r]!=null && converted[i][0]!=null && r<Alpha.length;r++){
temp=search(converted[i][0],Alpha[r]);
if(temp.compareTo(not)!=0){
    converted[i][1].concat(converted[i][1]+Alpha[r]);
    converted[i][2].concat(converted[i][2]+","+temp);



java.util.NoSuchElementException:找不到行读取异常
线程主"中的异常java.lang.ArrayIndexOutOfBoundsException:2
在nfa2dfa.NfaToDfa.converter(NfaToDfa.java:122)

[edit]仅标记-OriginalGriff [/edit]



java.util.NoSuchElementException: No line foundread exception
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at nfa2dfa.NfaToDfa.converter(NfaToDfa.java:122)

[edit]Tags only - OriginalGriff[/edit]

推荐答案

在外部循环中,您使用了converted[i],但是您没有检查
i < converted.Length
In the outer loop you used converted[i] but, you didn''t check that
i < converted.Length


这篇关于数组索引超出范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆