@dorothea_stoltenberg Вы можете использовать цикл и условие для проверки массива на наличие null
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
class Main { public static void main(String[] args) throws Exception { String[] array = {"Apples", null, "Bananas", "Oranges", null, "Kiwies", "Blueberries", null}; for (int i = 0; i < array.length; i++) { if (array[i] == null){ System.out.println("Массив содержит null"); break; } } // Вывод : Массив содержит null } } |