Skip to content
Advertisement

Adding values to Map from a File

I want to iterate through a file that has key/value pairs and put them into a Map.

The file contains values like so:

JavaScript

Here is my code:

JavaScript

The problem I am having is that the Map called instructions is not adding new values from the file, it stops at size 3, not sure why. Would appreciate some help here. Thanks!

Advertisement

Answer

This is an example of how you can calculate what you indicate in the comments.

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