Palindrome for Integers and Strings Java
<p>I'm trying to create Palindrome app for Integers and Strings in Java, I'm having an issue with my if statement, it outputs incorrect/repeating True and False statements:</p>

<pre><code>import java.util.Scanner;
import java.io.*;

public class Palindrome {
    public static void main(String[] args) {

        Scanner user_input = new Scanner(System.in);

        System.out.println("Enter characters to check for Palindrome: ");



        if ( user_input.hasNextInt() ){
            String intToString = String.valueOf(user_input.nextInt()).toString();
            String reversedInt = new StringBuffer(intToString).reverse().toString();

            for (int i = 0; i&lt;intToString.length(); i++) {
                if (intToString.charAt(i) != reversedInt.charAt(i)) { 
                        System.out.println("False");
                    }

                else {
                        System.out.println("True");
                    }
                }
            }


        else if ( user_input.hasNextLine() ) {
            String user_string = user_input.nextLine().replaceAll(" ", "").toLowerCase();
            StringBuilder user_mutable_string = new StringBuilder(user_string);
            user_mutable_string.reverse();

                if (user_string.equals(user_mutable_string.toString())) {
                    System.out.println("True");
                }

                else {
                    System.out.println("False");
                }   
            }

        else {
            System.out.println("Bonkers!");
        }

    }
}
</code></pre>