I'm looking for a way to map multiple keys to the same value without using extra memory by adding this value twice. Normally you would just do:
Map<Integer, Integer> map = new HashMap<>();
map.put(065,600);
map.put(070,600);
But it is my understanding that the value 600 is now stored in memory twice. Is there a way to avoid this such that they point to the exact same value? Thanks a bunch ! Peace out
, Integer>``
– Schidu Luca Mar 29 '18 at 12:05