首页 > 编程知识 正文

java数组下标越界怎么解决,Java下标越界

时间:2023-05-04 23:56:10 阅读:245750 作者:4673

//获取文本内容publicstaticListgetText(StringfilePath){Listsimples=newArrayList();try{FileReaderreader=newFileReader(filePath);BufferedReaderbfRead...

// 获取文本内容

public static List getText(String filePath) {

List simples =

new ArrayList();

try {

new FileReader(filePath);

new BufferedReader(reader);

String text =

null;

while ((text = bfReader.readLine()) != null) {

String[] texts = text.split(

"");

Simple simple =

new Simple();

simple.

Scheduled_title= texts[0];

simple.

Scheduled_execute_time = texts[1];

simple.

runTime = texts[2];

simples.add(simple);

}

}

catch (Exception e) {

e.printStackTrace();

}

return simples;

}

Input Error: java.lang.ArrayIndexOutOfBoundsException:1

at.com.CenDB.FileInsert.getText(FileInsert .java ;41)

at.com.CenDB.main(FileInsert .java ;53)

能不能帮我解决下问题?

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。