//x is the list and value is what it is to be set to for (int i = 0; i < x.length; i++) {   x[i] = value; }

Read more of this post