names[1] = "Sam";
names[2] = "Sam";
We'll need to use the instruction names[1] = "Sam"; to replace the second element in the array.