Here you can find the source of containsNullElement(List source)
Parameter | Description |
---|---|
source | a parameter |
public static boolean containsNullElement(List source)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /**/*from ww w .java2s.co m*/ * Checks whether 'list' has any null element in it. 1- if list itself is * null, return false 2- if list is empty, return false 3- if list contains * any null element, return true Note: Return true on first instance of * finding null element * * @param source * @return boolean */ public static boolean containsNullElement(List source) { if (source == null) return false; if (source.isEmpty()) return false; if (source.contains(null)) return true; return false; } }