Pessoal,
estou com um problemão.
Tenho um arquivo que guarda umas informações, e preciso colocá-lo em um mapa, mas esta dando um errinho besta que já tentei de todo jeito e não ajeito.
public void carregarArquivo() throws IOException{
Scanner sc = new Scanner(new File(this.caminho));
total = sc.nextInt();
for(int i=0; i<total; i++){
String[]informacoes = sc.next().split(",");
misturas.put(Integer.parseInt(informacoes[0]), new InformacoesPessoais(Integer.parseInt(informacoes[1]),
(informacoes[2]),
informacoes[3],
informacoes[4]));
}
}
Conteúdo do arquivo
2
0,10,"Teste","teste","teste"
1,20,"Teste com espaço","teste 1","teste 1"
ERRO
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
at GerenciadorInformacoesPessoais.carregarArquivo(GerenciadorInformacoesPessoais.java:28)
at Main.main(Main.java:13)