import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
for (int i = 0; i < 10; i++){
list.add("j a v a2s.com");
}
System.out.println(list);
Collections.fill(list, "java2s.com");
System.out.println(list);
}
}
[j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com, j a v a2s.com]
[java2s.com, java2s.com, java2s.com, java2s.com, java2s.com, java2s.com, java2s.com, java2s.com, java2s.com, java2s.com]