Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean isPalindorme(String word) {
- int ahead = 0;
- int behind = word.length - 1;
- while (behind > ahead) {
- if (word[ahead] != word[behind]) { return false; }
- ahead++; behind--;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement