My problem is that tthe commented out replace all methods cause errors.
/** * Write a description of class RecursivePalindrome here. * * @author (Landon L) * @version (12/7/13) */ public class RecursivePalindrome { /** * Constructor for objects of class RecursivePalindrome */ public RecursivePalindrome() { } public boolean isPalindrome(String word) { word = isPalindromeHelper(word); int a = word.length(); if(a == 0 || a == 1) return true; if(word.charAt(0)== word.charAt(a-1)) return isPalindrome(word.substring(1, a - 1)); else return false; } public String isPalindromeHelper(String word) { word = word.toLowerCase(); word = word.replaceAll(",",""); word = word.replaceAll(".",""); word = word.replaceAll("!",""); word = word.replaceAll(" ",""); word = word.replaceAll("\"\"",""); word = word.replaceAll("'",""); word = word.replaceAll(",",""); //word = word.replaceAll("?",""); //word.replaceAll("(",""); //word.replaceAll(")",""); return word; } }import java.util.*; public class RecursivePalindromeTester { public static void main(String[] args) { RecursivePalindrome recP = new RecursivePalindrome(); Scanner in = new Scanner(System.in); System.out.println("Type in word or phrase?(\"q\" to quit)"); String word = in.next(); if(word.charAt(0)!='q') { if(recP.isPalindrome(word)) System.out.println("This is a palindrome."); else System.out.println("This isn't a palindrome."); } else { System.out.println("Thanks. Come again, later!"); System.exit(0); } } }