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 firstname.lastname@example.org. 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.
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- Static methods vs Instance methods in Java
- Sentence Palindrome (Palindrome after removing spaces, dots, .. etc)
- Count all palindrome which is square of a palindrome
- Program to check if an array is palindrome or not using Recursion
- Program to check if an Array is Palindrome or not using STL in C++
- Java program to check whether a string is a Palindrome
- C Program to Check if a Given String is Palindrome
- Python program to check if a string is palindrome or not
- Bash program to check if the Number is a Palindrome
- Recursive program to check if number is palindrome or not
- Program to check the number is Palindrome or not
- Python program to check if given string is vowel Palindrome
- Program to check if an Array is Palindrome or not
- TCP Client-Server Program to Check if a Given String is Palindrome
- To check a number is palindrome or not without using any extra space
- Check if a string is palindrome in C using pointers
- Check whether the given string is Palindrome using Stack
- How to create a Circular image view in Android without using any library?
- How to create a CalendarPickerView using TimeSquare library
- How to create popup message using Alerter Library in android