Palindrome check not working
<pre><code>public class reverse
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a new string : ");
        String word = sc.nextLine();
        StringBuilder s = new StringBuilder();
        for (int i = 0; i &lt;= word.length() - 1; i++)
        {
            char c = word.charAt(word.length() - i - 1);
            s.append(c);
        }
        System.out.println("Reversed String = " + s);
        if (word.equals(s))
        {
            System.out.println("This is a palindrome");
        }
        else
        {
            System.out.println("This is not a palindrome");
        }
    }
}
</code></pre>

<p>This always prints "This is not a palindrome" no matter what string I give as input</p>
