How to determine if 5 digit number is a palindrome using an array?
<p>I'm in a beginning java class and having a tough time with this one. My professor gave us this pseudocode - 
create string sInput</p>

<pre><code>//
//    prompt for input
//
//    create char array (cArray) and assign sInput.toCharArray()
//
//    loop to check for palindrome (set i = 0, j = sInput.length()-1, check to see if i != j; increment i, decrement j)
//        check to see if current array values are !=
//            print not a palindrome
//            return
//        end of loop
</code></pre>

<p>I am at wit's end. Thanks for any suggestions!</p>

<p>I have </p>

<pre><code>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) &amp;&amp; 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.");
</code></pre>
