>>8
public static boolean isPalindrome(String s) {
switch (s.length()) {
case 0:
return false;
case 1:
return true;
case 2:
return s.charAt(0) == s.charAt(1);
default:
if (s.charAt(0) == s.charAt(s.length() - 1)) {
return isPalindrome(s.substring(1, s.length() - 1));
} else {
return false;
}
}
}