Java tutorial
//package com.java2s; //License from project: Apache License public class Main { /** * @param values string values to test * @return true if each string isn't equal to null and isn't empty */ public static boolean isValid(String... values) { if (values == null || values.length == 0) { return false; } for (String value : values) { if (value == null || value.isEmpty()) { return false; } } return true; } }