Welcome to the World of Online Learning:
Hello Friends “This blog helps you to learn Java programming concepts. You can learn Java language at your own speed and time. One can learn concepts of Java language by practicing various programs given on various pages of this blog. Enjoy the power of Self-learning using the Internet.”

Write a Java Program to Check Palindrome
PROGRAM: Java Program to Check Palindrome
/* Java Program to Check Palindrome */
1: Java Program to Check Palindrome String
class Main {
public static void main(String[] args) {
String str = “Radar”, reverseStr = “”;
int strLength = str.length();
for (int i = (strLength – 1); i >=0; –i) {
reverseStr = reverseStr + str.charAt(i);
}
if (str.toLowerCase().equals(reverseStr.toLowerCase())) {
System.out.println(str + ” is a Palindrome String.”);
}
else {
System.out.println(str + ” is not a Palindrome String.”);
}
}
}
2: Java Program to Check Palindrome Number
class Main {
public static void main(String[] args) {
int num = 3553, reversedNum = 0, remainder;
// store the number to originalNum
int originalNum = num;
// get the reverse of originalNum
// store it in variable
while (num != 0) {
remainder = num % 10;
reversedNum = reversedNum * 10 + remainder;
num /= 10;
}
// check if reversedNum and originalNum are equal
if (originalNum == reversedNum) {
System.out.println(originalNum + ” is Palindrome.”);
}
else {
System.out.println(originalNum + ” is not Palindrome.”);
}
}
}