Java Hash Table Issue with Object Reference
问题 I have a Hash Table like, HashTable ht = { (1, 1), (2, 1), (3, 1) } Now, I implement it like, Integer foo = Integer(1) and declare hash table like, HashTable ht = { (foo, foo), (2, foo), (3, foo) } Now, as per I understood from this, it will reduce heap space used by JVM. Is this correct ? Another point is that, in C, I usually use structure like, HashTable ht = { (1, mem), (2, mem), (3, mem) } { where mem is memory location (say 10) of 1 } And then use the location to access the value. Now,