To change an array element, assign to it using bracket notation. Write arr[2] = 100; to set the third element to 100. The left side specifies which slot, the right side provides the new value.
You can modify elements anywhere after declaration. Arrays are mutable. Read with arr[i], write with arr[i] = newValue, or combine: arr[i] += 10; adds 10 to the current value. Multiple modifications to the same element are fine.
Each assignment replaces the previous value. The final value is whatever you assigned last. Arrays update based on calculations or input.