Given a string, write a Java function to check if it is palindrome or not. A string is said to be palindrome if reverse of the string is same as string. For example, “abba” is palindrome, but “abbc” is not palindrome. The problem here is solved using string reverse function.
Input : malayalam Output : Yes Input : GeeksforGeeks Output : No
Related Article :
C program to check whether a given string is palindrome or not
This article is contributed by Bhargav Sai Gajula. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Java program to check whether a string is a Palindrome
- Program to check the number is Palindrome or not
- Program to check if an Array is Palindrome or not using STL in C++
- Program to check if an Array is Palindrome or not
- C Program to Check if a Given String is Palindrome
- Python program to check if a string is palindrome or not
- Program to check if an array is palindrome or not using Recursion
- Bash program to check if the Number is a Palindrome
- Recursive program to check if number is palindrome or not
- TCP Client-Server Program to Check if a Given String is Palindrome
- Python program to check if given string is vowel Palindrome
- Static methods vs Instance methods in Java
- Java SAX Library
- Program to check if a String in Java contains only whitespaces
- Program to check if the String is Empty in Java