// File: Palindrome.java
// Time-stamp: "2005-01-09 12:35:36 calvanese"

/*
   Static method that, given a string s, returns the boolean value true
   if the string is a palindrome, false otherwise.
   A string is palindrome if, when the string spelled from left to right it
   is equal to the string spelled from right to left.
   (e.g., "anna" and "ailatiditalia" are palidrome strings).
*/

public class Palindrome {
	
  public static boolean palindrome(String s) {
    int len = s.length();
    if (len <= 1)
      return true;
    else 
      if (s.charAt(0) != s.charAt(len-1))
        return false;
      else
        return palindrome(s.substring(1,len-1));
  }
}
