Write a java program to check whether a string is a palindrome. Ashutosh Patel 134 22-Mar-2023 Write a java program to check whether a string is a palindrome. java java programs Updated on 19-Apr-2023
Can you answer this question?
Hello this is Gulshan Negi
Well, here is the program that you should try.
I hope it will help you.
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.