how to fill a list with a single value java

Solutions on MaxInterview for how to fill a list with a single value java by the best coders in the world

showing results for - "how to fill a list with a single value java"
Matilda
20 Apr 2020
1//x is the list and value is what it is to be set to
2for (int i = 0; i < x.length; i++) {
3  x[i] = value;
4}