Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+12 votes

I was creating a map from characters to their corresponding Morse code and back; Is there a better way in Java, rather than manually populating two separate HashMaps?

asked in CSC 305 Fall 2024 by (4.4k points)
edited by

1 Answer

+3 votes

What I did was make 2 private maps, one for char to morse and morse to char, then populated one of them manually. you could then loop through that map, reverse the key and value, and add it to the other map. hope this helps

answered by (2k points)
...