Estou tendo dificuldade no trecho de um código onde preciso ler os dados de uma variável salvos anteriormente em um arquivo.txt
Segue trecho do código:
public void PTIPO ( Estatistica[ ] estatistica ) throws IOException {
int i;
String fileName = "ArquivoEstatistica.txt";
BufferedReader ler = new BufferedReader(new FileReader( fileName ));
for (i = 0 ; i < 5 ; i++)
estatistica[i] = new Estatistica();
for (i = 0 ; i < 5 ; i++) {
estatistica[i].veiculo = Integer.parseInt(ler.readLine());