Here you can find the source of duplicateArrayEntries(String[] inputArr, int numDuplicates)
public static String[] duplicateArrayEntries(String[] inputArr, int numDuplicates)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static String[] duplicateArrayEntries(String[] inputArr, int numDuplicates) { List<String> list = new ArrayList<String>(); for (String d : inputArr) { for (int i = 0; i < numDuplicates; i++) { list.add(d);/*from w w w.j a v a2 s . co m*/ } } return list.toArray(new String[0]); } }