Back to the Program-A-Day homepage
Problem
Complete the program Palindrom that checks if a word is palindrome.
If the word is palindrome, print out "It's a palindrome." using System.out.println().
Otherwise, print out reversed order of the word.
For example, "deed" and "civic" are palindromes.
"tomato" and "mama" are not palindromes.
Two strings are provided and find out whether they are palindromes or not.
The program that you need to complete is provided below.
public class asd
{
public static void main(String[] args)
{
String testWord1 = "Arewenotdrawnonward,wefew,drawnonwardtonewera"
String testWord2 = "Murderforajarofredrum"
// Your code goes here
}
}
|
|
...by students
Taken from http://www.flickr.com/photos/daniello/565304023/
An image or By Students section
|
Solution
The solution...
|
Code
Solution Code
public class HelloWorld
{
}
|
Back to the Program-A-Day homepage