+ 1
Can you print the first argument by 'getting' the second?
I've written a small programme to see if I understood HashMaps, by using Scanner to let the user input their name and their age. When I use System.out.println("Hello " + info.get(age)); It displays "Hello null" So is there a way to make it work?
2 Respuestas
0
Nevermind, I just have to turn around the put arguments. I had info.put(name, age); Turning those around did it
0
getInt??