//CS5-HMC-Sp.,00-HW13-1 //A. Khakpour, Apr., 00 public class PalindromeTester1 { // Creates a PTester object, and tests strings. public static void main (String args[]) { PTester tester = new PTester(); String str; System.out.println("Enter a potential palindrome: "); str = Keyboard.readString(); System.out.println ("Is this a palindrome? " + tester.ptest(str)); } } class PTester { // Uses recursion to perform the palindrome test. public boolean ptest (String s) { boolean result = false; if (s.length() <= 1) result = true; else if (s.charAt (0) == s.charAt (s.length()-1)) result = ptest (s.substring (1, s.length()-1)); return result; } }