私は、行ごとにテキストファイル行をスキャンするプロジェクトに取り組んでおり、行ごとに、行の各単語が配列に格納されます
これが今の私のコードです。Answer.txtファイルからの格納になるとエラーになります。誰かが私を助けてくれますか?
try
{
String s = sc.nextLine();
//System.out.println(s);
String[] Question = s.split(" ");
for(int i=0;i<=Question.length;i++)
{
System.out.println(Question[i]);
}//debug
s = sc2.nextLine();
//System.out.println(s2);
String[] Answer = s.split(" ");
for(int c=0;c<=Answer.length;c++)
{
System.out.println(Answer[c]);
}//debug
}
catch (ArrayIndexOutOfBoundsException e)
{
System.out.println("...");
}