1. The address of the object is stored in the array.
public class ArrayTest3 {public static void main (string[] args) {i[] I = new i[2]; I[0] = new C (); I[1] = new C (); }}interface I{}class C implements i{}
The above code can be compiled and run through, the same validation of the above conclusion: the array is stored in the object's address.
Regardless of what type of array is generated, the array holds the address of the object of that type, not the object of that type. If no object is assigned to the array, NULL is stored.
i[] i = new i[2]; The code is not the object that generates I, and the interface cannot generate the object. The I array can only hold the object address of the class that implements the I interface.
2. Arrays are also objects, and the following code compares two array objects that hold the same number with the Equals method, because it is two different objects.
public static void Main (string[] args) {int[] a = {-N-a}; Int[] B = {A-c}; System.out.println (A.equals (b)); }
Java record -33-array store object address