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