Write a java program to check whether a string is a palindrome.
Write a java program to check whether a string is a palindrome.
Jr. Software Developer
I am a software developer at MindStick soft. Pvt. ltd. I joined this company in august 2021 after completing my post-graduation course. I love to see the historical places of my country.
Chnaged Data
Hello this is Gulshan Negi
Well, here is the program that you should try.
I hope it will help you.
Thanks
Given below is a code to check whether a given string is palindrome or not.
Here, we reverse the given string and store it in another string object. Then, we check each letter of both the given string and reversed string. If the characters are not the same at any point, we set flag = 0 and breaks from the loop.