Check out example codes for "changing the elements of an array using a for loop java". It will help you in understanding the concepts better.

Code Example 1

int[] anIntArray = new int[6];
/*
	This is for when you want to increment the contents of an array 
    using a for loop.
*/
for (int i = 0; i < anIntArray.length; i++) {
    anIntArray[i]++;                      
}

//=============================================================================

String[] aStringArray = new String[6];
/*
	This is for when you want to change the contents of an array
    using a for loop
*/
for (int i = 0; i < aStringArray.length; i++) {
	aStringArray[i] = 'The value it should change to'; //Should be compatible with the array type
}

Learn ReactJs, React Native from akashmittal.com