String currentLine = reader.readLine();
while (currentLine != null)
{
String[] studentDetail = currentLine.split("");
String name = studentDetail[0];
int number = Integer.valueOf(studentDetail[1]);
currentLine = reader.readLine();
}
So I have a file like this:
student1
student16
student6
student9
student10
student15
When I run the program said: ArrayIndexOutOfBoundsException:1
the output should look like this:
student1
student6
student9
student10
student11
student15
student16