Java tutorial
import java.util.Collections; import java.util.List; public class Main { public static void main(String[] args) { // create a list with n copies List<String> list = Collections.nCopies(5, "java2s.com"); System.out.println(list); } }