Use Integer instead.
HashMap<Integer, MyObject> myMap = new HashMap<Integer, MyObject>();
Java will automatically autobox your int primitive values to Integer objects.
Read more about autoboxing from Oracle Java documentations.
Use Integer instead.
HashMap<Integer, MyObject> myMap = new HashMap<Integer, MyObject>();
Java will automatically autobox your int primitive values to Integer objects.
Read more about autoboxing from Oracle Java documentations.