Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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