A palindrome is a word, phrase, number or other sequence of units that can be read the same way in either direction.
To check whether a word is a palindrome I get th
Here you can check palindrome a number of String dynamically
import java.util.Scanner;
public class Checkpalindrome {
public static void main(String args[]) {
String original, reverse = "";
Scanner in = new Scanner(System.in);
System.out.println("Enter How Many number of Input you want : ");
int numOfInt = in.nextInt();
original = in.nextLine();
do {
if (numOfInt == 0) {
System.out.println("Your Input Conplete");
}
else {
System.out.println("Enter a string to check palindrome");
original = in.nextLine();
StringBuffer buffer = new StringBuffer(original);
reverse = buffer.reverse().toString();
if (original.equalsIgnoreCase(reverse)) {
System.out.println("The entered string is Palindrome:"+reverse);
}
else {
System.out.println("The entered string is not Palindrome:"+reverse);
}
}
numOfInt--;
} while (numOfInt >= 0);
}
}