I didn't understand why I1.array[0]=555 is? I only want to change arr[0]
Intar I1 = new Intar(10);
int [] arr = I1.array;
arr[0]=555;
public class Intar {
int length;
int [] array;
public Intar(int lengt){
length=lengt;
array=new int[lengt];
Random ran =new Random();
for(int i=0; i<length; i++){
array[i]= ran.nextInt(100);
**When I use System.out.println before and after arr[0]=555 **
I1.array [11, 57, 77, 74, 50, 62, 1, 11, 23, 27]
arr [11, 57, 77, 74, 50, 62, 1, 11, 23, 27]
After arr[0]=555
I1.array [555, 57, 77, 74, 50, 62, 1, 11, 23, 27]
arr [555, 57, 77, 74, 50, 62, 1, 11, 23, 27]