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.HashMap;
import java.util.List;
import java.util.Map;

public class Main {
    public static <T> void clear(List<T> list) {
        if (list == null) {
            list = new ArrayList<T>();
        } else {
            list.clear();
        }
    }

    public static <K, V> void clear(Map<K, V> map) {
        if (map == null) {
            map = new HashMap<K, V>();
        } else {
            map.clear();
        }
    }
}