Java examples for Collection Framework:Array Contain
Check that an array only contains elements that are not null.
//package com.java2s; public class Main { /**//from w w w . ja v a2s .c om * Check that an array only contains elements that are not null. * @param values, can't be null * @return */ public static boolean containsOnlyNotNull(Object... values) { for (Object o : values) { if (o == null) { return false; } } return true; } }