For some reason it's. always returning false even if an item from the array x is entered.import java.util.*; public class Main { public static boolean isPart; public static String x[] = {"One", "Two", "Three", "Four", "Five"}; public static void main(String[] args) { isPartOfArray(); } public static boolean isPartOfArray() { Scanner scan = new Scanner(System.in); System.out.println("What is your name?"); String input = scan.nextLine(); System.out.println(input); int i; for(i = 0; i< 4; i++) { } if(input.equals(x[i])) { System.out.println("Name recognized"); isPart = true; } else { System.out.println("Name not recognized"); isPart = false; } return isPart; } }