Lets say I have a class as below:
public class class1{
private int[] array1;
public class1(){
array1 = new int[10];
}
public int[] getArray(){
return array1;
}
}
If I create an instance of this class in another class or in main and use the getArray() method to assign the array to another variable in the upper class and then modify the values of the array there, will the original array values in the first class be modified also?