I have writen a code like below-
public class ArrayExample {
public static void main(String[] args) {
int[] myArray = { 20, 50, 40, 8 };
for (int i = 0; i < myArray.length; i++) {
System.out.println(myArray[i]);
}
}
}
output is: 20 50 40 8
Now i want to change the value of myArray.Now I want to set myArray = {100,1,200,80};
I have searched and tried but unable to do this.Please Java Experts need your help.