Array of object references
问题 In Java, let a custom object o is of type CustomObject . Then CustomObject o2 = o; would make a reference without copying the contents of o to o2 . But will this behaviour remain for an array of CustomObject s: CustomObject[] os = new CustomObject[2]; os[1] = o; os[2] = o; Will os[1] and os[2] be references or they will be direct copies of o and thus separate objects? 回答1: Well, you actually mean os[0] and os[1] as arrays are 0-based in Java... but yes, they'll be references. Both array