When learning HashMaps in C++ I had to create the whole algorithm. In the code I created I could simply place a string into the method and it would store the names for me by turning the string into a integer and storing is accordingly. If there was a collision it would grow linearly at that location.
//play with Hash Tables void getNames(String names) { HashMap<String, Integer> map = new HashMap<String, Integer>(); map.put(names,22); }
How can I do this in Java. I read about them and look at examples and they all for the most part look like this.