Skip to content
Advertisement

adding strings (key) to a Map where the value is the length of each String

Need to add 4 Strings – as a keys, using scanner, to a Map and the value has to be the lenght of each String.

for example: “House” – 5 etc .

JavaScript

Advertisement

Answer

You’r calling the scanner twice, so that’s 2 input as you need only one per word

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement