Last active
August 15, 2022 23:03
-
-
Save w3cj/14c22ac9ac4daac77c904e4254181982 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run from the command line with: | |
// javac PalindromeTester.java && java PalindromeTester | |
public class PalindromeTester { | |
public boolean isPalindrome(String input) { | |
// your code here | |
return false; | |
} | |
public static void main(String[] args) { | |
printTestPalindrome("race car"); //true | |
printTestPalindrome("wat"); //false | |
printTestPalindrome("stack cats"); //true | |
printTestPalindrome("who"); //false | |
printTestPalindrome("step on no pets"); //true | |
printTestPalindrome("when"); //false | |
printTestPalindrome("taco cat"); //true | |
} | |
public static void printTestPalindrome(String input) { | |
PalindromeTester tester = new PalindromeTester(); | |
System.out.println(input + ": " + tester.isPalindrome(input)); //true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment