Adding to a attribute of an object in a map
If I had a HashMap
Where Pupil is an Pupil object from another class which contains an array attribute called grade.
[/HTML]this.pupils = new HashMap<String, Pupil>();
And then i had a forEach loop within a method. Part of the method is below.
I'm stuck as how to assign score to each of the objects array attribute grade.
if(test == true)
for(String name : pupils.keySet())
score = 76;
Logic to me says i want to be using a pupils.put() command but i am struggling to work out how to make it access the grade array within the pupil object within the map.
Any possible pointers?