Java Program to Check whether a String is a Palindrome
public class Palindrome.
String a, b = "";
Scanner s = new Scanner(System.
System. out. print("Enter the string you want to check:");
a = s. nextLine();
int n = a. length();
for(int i = n - 1; i >= 0; i--)
b = b + a. charAt(i);
Copyright © 2024 EHUB.TIPS team's - All rights reserved.
Answers & Comments
Java Program to Check whether a String is a Palindrome
public class Palindrome.
String a, b = "";
Scanner s = new Scanner(System.
System. out. print("Enter the string you want to check:");
a = s. nextLine();
int n = a. length();
for(int i = n - 1; i >= 0; i--)
b = b + a. charAt(i);