My Java code is here:
import java.util.Scanner;
public class task2 {
public static void main(String args[]) {
System.out.print(\"Input a 3 digit int
Here's how I'd do it: I'd use the libraries more and write a lot less code.
I'd recommend that you learn the Sun Java coding standards and develop a formatting style. Readability promotes understanding. Style and neatness matter.
package misc;
public class PalindromeChecker {
public static void main(String args[]) {
for (String arg : args) {
System.out.println(String.format("arg '%s' is" + (isPalindrome(Integer.valueOf(arg)) ? "" : " not") + " a palindrome", arg));
}
}
public static boolean isPalindrome(int value) {
String s = Integer.toString(value);
String reversed = new StringBuilder(s).reverse().toString();
return reversed.equals(s);
}
}