I have:
but the assignment is requiring me to use an array which I don't know how to do. Please Help!public static void main(String[] args) { while (true) { display(check(retrieveInput())); } } public static String retrieveInput() { Scanner scan = new Scanner(System.in); return scan.next(); } public static boolean check(String input) { boolean check = false; try { Integer.parseInt(input); if (input.charAt(0)==input.charAt(4) && input.charAt(1)==input.charAt(3)) check = true; } catch(Exception e) { check = false; } return check; } public static void display(boolean check) { if(check) System.out.println("Is a five-digit palindrome."); else System.out.println("Is not a five-digit palindrome."); } }