+ 2
Please how can I solve this problem
A hash map has so many employees and each employee had these attributes: Note,name,age So I want to store the notes of each employee in another hash map. https://code.sololearn.com/c4A12a21A19A/?ref=app
1 Antwort
+ 1
if all you want is to copy the notes from all employees in to a map, then u just need to do:
employeeMap.forEach((k,v)->{noteMap.put(k,v.note);});
in my example noteMap would be declared as Map<Long,Long>, the key would be the emplyee key and the value would be note which is a Long.