Java Object and array memory location
问题 I'm writing an array-backed hashtable in Java, where the type of key and value are Object; no other guarantee. The easiest way for me code-wise is to create an object to hold them: public class Pair { public Object key; public Object value; } And then create an array public Pair[] storage = new Pair[8]; But how does the jvm treat that in memory? Which is to say, will the array actually: be an array of pointers to Pair() objects sitting elsewhere, or contain the actual data? edit Since the