Java Array Remove removeNull(T[] data)

Here you can find the source of removeNull(T[] data)

Description

remove Null

License

Creative Commons License

Declaration

private static <T> T[] removeNull(T[] data) 

Method Source Code


//package com.java2s;
//License from project: Creative Commons License 

import java.util.ArrayList;

public class Main {
    private static <T> T[] removeNull(T[] data) {
        ArrayList<T> temp = new ArrayList();
        for (T f : data)
            if (f != null)
                temp.add(f);//from   w w w .java  2s .  c o m
        return temp.toArray(data);
    }
}

Related

  1. removeLast(byte[] target, int end)
  2. removeLowScore(int[] array)
  3. removeMethodsOption(String[] args)
  4. removeNaN(double[] x1)
  5. removeNodes(T[] array, T sampleNode)
  6. removeNullElements(String[] x)
  7. removeNulls(Object[] arr)
  8. removeNulls(T[] array)
  9. removeNulls(T[] array)