i have a 3 lines text of int that are data i need to put in some variables, i want to access one by one to all like an array, i can read the firt line but don't know how to go to next line, i know it 's a stupid thing but i'm blocked
public void Load () throws IOException {
BufferedReader in = new BufferedReader(new FileReader("prova.txt"));
String inputLine = in.readLine();
String [] fields = inputLine.split(" "); // Splits at the space
int i=0;
while(inputLine!=null) {
System.out.println(fields[i]); //prints out name
i++;
}
}
i wanto to access to a single int for any line, any tips?