palindrome integers java softuni code example
Example 1: integer palindrome in java
public boolean isPalindrome(int x) {
String str = Integer.toString(x);
String reverse = new StringBuilder(str).reverse().toString();
return str.equals(reverse)?true:false;
}
Example 2: integer palindrome in java
public boolean isPalindrome(int x) {
String str = Integer.toString(x);
String reverse = new StringBuilder(str).reverse().toString();
return str.equals(reverse)?true:false;}