Palindrome String In Java

Sharing is healthy !!

Here you learn palindrome string in java.

Palindrome string is a string where string remains same when reversed.

For example: dad, mom, madam, abcba, etc.,

example: Palindrome String In Java

Also Read – Palindrome Number In Java

import java.util.*;

public class Palindrome_String_In_Java {

public static void main(String[] args) {

String original;
String reverse = "";

Scanner sc = new Scanner(;
System.out.println("Please enter a string to check: ");
original = sc.nextLine();
int number = original.length();

for(int a = number - 1;a >= 0;a--)
reverse = reverse + original.charAt(a);

System.out.println(original + " is a Palindrome string.");
System.out.println(original + " is not a Palindrome string.");


Palindrome String In Java

Sharing is healthy !!

Leave a Reply

Your email address will not be published.