Итак, вот что у меня есть на данный момент:
public String[] findStudentInfo(String studentNumber) {
Student student = new Student();
Scanner scanner = new Scanner("Student.txt");
// Find the line that contains student Id
// If not found keep on going through the file
// If it finds it stop
// Call parseStudentInfoFromLine get the number of courses
// Create an array (lines) of size of the number of courses plus one
// assign the line that the student Id was found to the first index value of the array
//assign each next line to the following index of the array up to the amount of classes - 1
// return string array
}
Я знаю, как определить, содержит ли файл строку, которую я пытаюсь найти, но я не знаю, как получить всю строку, в которой он находится.
Это мой первый пост, поэтому, если я сделал что-то не так, сообщите мне.