i have quick question, what I am trying to do here is to, get the Student from HashMap and adds a double mark to Student's mark.
lets say i have class called Student and Student class has method called addToMark() and Hashmap called theStudent = new HashMap<String, Student>.
public void addExtraMark(String studentNumber, double mark) {
if(stuentNumber != null && mark >= 0) {
Student extraMark = theStudent.get(studentNumber);
extraMark.addToMark(mark)};
}
}
my question is, does mark adds to hashmap? automatically? or do i have to use
theStudent.put(studentNumber, extraMark);
on the bottome of my code?