Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    /**
     * 
     * @param <T>
     * @param list
     */
    public static <T> void filterNulls(List<T> list) {
        if (null == list || list.isEmpty())
            return;
        for (int i = 0; i < list.size(); i++) {
            T current = list.get(i);
            if (null == current) {
                list.remove(i);
            }
        }
    }
}