Group: comp.lang.java.programmer
From: Roedy Green
Date: Wednesday, April 02, 2008 10:55 AM
Subject: Re: palindrome

On Tue, 01 Apr 2008 23:16:49 GMT, "Benjamin Rushing"
wrote, quoted or indirectly quoted someone
who said :

>I've been tasked with writing a simple java program where the user inputs a
>5 digit number and the program states whether it's a palindrome or not.
>I can't use an array or use the 'reverse' function of code. Anybody willing
>to give me a hint on how to procede?

Slacker's solution:

Reading the number as a string is no problem. It is extra work to read
it as an int.

See http://mindprod.com/applet/fileio.html

reverse the string. Compare.

To reverse the string without using reverse, cheat, and see how
reverse does it by looking at the code in source.zip

But the point is to LEARN java, not create a palindrome detector, so
this is a stupid solution.

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com