String stringStudentId = null;int studentId = 0;if (lines.contains("StudentID:")) {stringStudentId= this.getNextStringStartsWith("StudentID:");try {studentId = Integer.parseInt(stringStudentId);}catch (NumberFormatException e) {e.printStackTrace();}} return studentId;}