In below code, assigning the a array object to another array object t. these two are different objects in the memory right? why changing one object is impacting other object content?
package test.main; import java.util.LinkedHashSet; import java.util.Set; public class C1 implements I1,I2{ /** * @param args */ public static void main(String[] args) { int [][] a= {{1,2}}; int [][] t= {}; t=a; t[0][0] = 3; System.out.println("t "+t[0][0]); System.out.println("a "+a[0][0]); } @Override public void staticMethod() { // TODO Auto-generated method stub } } output:
t 3 a 3