Words combining together
<p>Why is my code combining the old word with the new word? Input is "banana" output "banana" new input "dog" output "bananadgo"?  </p>

<pre><code>public static void main(String [] args)
{
    Scanner keyboard = new Scanner(System.in);
    String word, afc, newWord;
    String s="";

    do
    {
        word=keyboard.next().toLowerCase();
        int i =word.length()-1;
        char firstLetter=word.charAt(0);
        afc=word.substring(1);
        newWord= afc+firstLetter;

        for( ; i&gt;=0 ; )
        {
            s += newWord.charAt(i--);
        } 
        System.out.println(word + "," + s);

        if (s.equals(word))
            System.out.println("Words are equal.");
        else
            System.out.println("Words are not equal.");
    }
    while (!(word.equals("quit")));

}
</code></pre>
