how to fill a list with a single value java

Java
//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;
}
Source

Also in Java: