get string value from HashMap depending on key name
Just use Map#get(key) ? Object value = map.get(myCode); Here’s a tutorial about maps, you may find it useful: https://docs.oracle.com/javase/tutorial/collections/interfaces/map.html. Edit: you edited your question with the following: I’m expecting to see a String, such as “ABC” or “DEF” as that is what I put in there initially, but if I do a System.out.println() I get … Read more