You need to make your HashMap, i.e. to Map[x] = (String Key, Integer Value) , where x is calculated by the lance, for example, Сумма Ascii в Key % Размер Map
I’ve covered everything, I can’t find how to implement Map so that I can manually specify the save location Map[x] = (String Key, Integer Value) .
Map<String, String> map[] = new Map[3]; map[0].put("1", "Jan"); map[1].put("2", "Feb"); map[2].put("3", "Mar"); gives out
Exception in thread "main" java.lang.NullPointerException at UB4_Anders.HashMapMain.main(HashMapMain.java:36)
map[]is an array ofMaptype objects.map[0].putis an attempt to add an element to the firstMapfrom this array. Are you sure that this is exactly what you want to do? - RegentMap(public class MyMap<K, V> implements Map<K, V> { ... }) and want to make a special way of adding a key-value pair, then besides thepublic V put(K key, V value)methodpublic V put(K key, V value)to do a separate method (for example,public V put(int keyCode, K key, V value)). - Regent