Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { public static String[] insertAtLast(String[] resource, String str, int addQuan) { List<String> list = new ArrayList<>(); for (int i = 0; i < resource.length; i++) { list.add(resource[i]); } for (int i = 0; i < addQuan - resource.length; i++) { list.add(str + (i + resource.length)); } String[] result = list.toArray(resource); return result; } }