import javax.swing.JOptionPane; public class Palindrome { { long num; long temp; String inputStr; String outputStr; inputStr = + "positive or negative"); temp = num; if (num <= 0) { num = -num; inputStr = inputStr.valueOf(num); } if (isPalindrome (inputStr)) outputStr = temp + " is a palindrome"; else outputStr = temp + "is not a palindrome"; } { int len = str.length(); int i, j; j = len - 1; for (i = 0; i <= (len - 1)/2; i++) { if (str.charAt(i) != str.charAt(j)) return false; j--; } return true; } }