Tenho um .txt chamado aaaa com o seguinte conteudo
Nome1;1
Nome2;2
Nome3;3
Nome4;4
Nome5;5
public void loadTextFile()
{
String filePath = "aaaa.txt";
try {
BufferedReader in = new BufferedReader(new FileReader(filePath));
String str;
while ((str = in.readLine()) != null) {
String data[] = str.split(";");
System.out.println("Nome: " + data[0] + " Numero:" + data[1]);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
System.out.println("Erro ao ler arquivo de texto " + e.toString());
}
}
Mas recebo "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1"
Alguem consegue achar algum erro ai?