Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.*;

public class Main {

    public static <T> Collection<T> defaultCollection(Collection<T> col, int size, T defaultValue) {
        try {
            col.clear();
        } catch (Exception e) {
        }
        for (int i = 0; i < size; i++) {
            col.add(defaultValue);
        }
        return col;
    }
}