1package test
2//The function below checks if a string is a palindrome
3//True = Is a palindrome & False = Not a palindrome
4 public boolean isPalindromString(String text){
5 String reverse = reverse(text);
6 if(text.equals(reverse))
7 {
8 return true;
9 }
10
11 return false;
12 }
13//This function returns the reverse String of its input.
14//Ex. if given "hello", it will return "olleh"
15 public String reverse(String input)
16 {
17 if(input == null || input.isEmpty())
18 {
19 return input;
20 }
21 return input.charAt(input.length()- 1) + reverse(input.substring(0, input.length() - 1));
22 }