Results 1 to 3 of 3
Thread: Palindrome
- 04-29-2011, 02:56 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 16
- Rep Power
- 0
- 04-29-2011, 03:03 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 339
- Rep Power
- 5
You can tell a palindrome by reversing the text and comparing it with the original. For numbers, just convert them to Strings first:
Java Code:boolean isPalindrome = text.equals(new StringBuilder(text).reverse().toString());
- 04-29-2011, 03:20 PM #3
Smells like a homework assignment. What have you tried? Where are you stuck?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Palindrome program help
By Nel in forum New To JavaReplies: 1Last Post: 03-03-2011, 03:49 AM -
Palindrome question
By luke in forum New To JavaReplies: 20Last Post: 10-02-2010, 01:17 AM -
Palindrome
By pinkdreammsss in forum Java AppletsReplies: 8Last Post: 05-04-2010, 03:59 PM -
HELP...Palindrome
By d7o0om in forum New To JavaReplies: 12Last Post: 11-13-2009, 03:32 AM -
Palindrome Test
By Ada in forum New To JavaReplies: 1Last Post: 05-26-2007, 01:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks