You are on page 1of 1

Palindrome Java

public class Palindrome {


public static void main(String[] args) {
System.out.println(Palindrome.isPalindrome("Deleveled"));
}

public static boolean isPalindrome(String word) {


String reverse = "";
for (int i = word.length() - 1; i >= 0; i--) {
reverse = reverse + word.toLowerCase().charAt(i);
}

if (word.toLowerCase().equals(reverse)) {
return true;
}
return false;
}
}

You might also like