We have to give string as an input and check it is palindrome or not i.e. original string and reverse of that string should be same.
In this tutorial, the string is given as an input so that we can check it is palindrome or not.In the code which is in Java , asked to enter the given string and reverse of that string is traced.
If the reverse string is same as original string then it is Palindrome.
String 1 : level ,reverse string 1: level = String is Palindrome
String 2 : janar, reverse string 2:ranaj = Not palindrome
String 3 : rar, reverse string 3: rar = String is Palindrome