Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. public static boolean isPalindorme(String word) {
  2. int ahead = 0;
  3. int behind = word.length - 1;
  4.  
  5. while (behind > ahead) {
  6. if (word[ahead] != word[behind]) { return false; }
  7. ahead++; behind--;
  8. }
  9.  
  10. return true;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement