Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}