import java.util.Arrays; // For String String[] array = {"Boto", "Nesto", "Lepta"}; String toSearch = "Nesto"; // Inline if (Arrays.toString(array).contains(toSearch)) { // Do something if it's found }