I'm working on my coursework and came up with this situation. Here's my code.
public static ArrayList<Student> checkPresent(String unitID, String week){
int present = 0;
ArrayList<Student> studentDetails = Student.getStudentDetails();
ArrayList<AttendanceLog> pickedList = AttendanceLog.pickFromAttendanceLog(unitID, week);
for(Student student : studentDetails){
student.setPresent("N");
for(AttendanceLog attendance : pickedList){
if(student.getStudentNo().equals(attendance.getStudentID())){
student.setPresent("Y");
present++;
}
}
}
return studentDetails;
}
I have only returned the ArrayList
but I also want to get the integer value present
. Is it possible? Or how can I take the int value ?