I have a hashmap that hold k,v like this:
HashMap<String, String> total=new HashMap<>();
this is how im populating the map:(in a for loop from some result of db table)
total.put(rs.getString("id"), rs.getString("name"));
Now, some keys have multiple values, I want to print for each key: key and value. so it will look something like this:
123 john
123 tom
123 jack
234 terry
234 jeniffer
345 jacob
555 sara
how can I do this please?
thanks