How do I parse a string as an Integer
<p>OK I have my rock,paper,scissors game working. All but the Q to quit works. Since my scanner is only taking integers, how can I pass the "Q" string to it. I would assume I just add a simple <code>if(string.equals("Q") {break;}</code> in the while loop and I'll be good to go. Let me know what you think.</p>

<pre><code>import java.util.Scanner;
import java.util.Random;

public class RockPaperScissors
{

    /**
     * (Insert a brief description that describes the purpose of this method)
     * 
     * @param args
     */
    public static void main(String[] args)
    {
        int compint;
        String usermove = "";
        String compmove = "";
        String winner = "";
        int count = 0;
        int input=0;


        Scanner in = new Scanner(System.in);
        Random gen = new Random();

        System.out.print("Enter Rock(1), Paper(2), Scissors(3) {Q to quit]: ");
        input=in.nextInt();
        while (count &lt; 3)
        {
            compint = gen.nextInt(3) + 1;

            if (input == 1)
            {
                usermove = "Rock";
            }
            else if (input == 2)
            {
                usermove = "Paper";
            }
            else if (input == 3)
            {
                usermove = "Scissors";
            }

            if (compint == 1)
            {
                compmove = "Rock";
            }
            else if (compint == 2)
            {
                compmove = "Paper";
            }
            else if (compint == 3)
            {
                compmove = "Scissors";
            }

            if (compint == input)
            {
                winner = "TIE";
            }
            else if (compint == 1 &amp;&amp; input == 3)
            {
                winner = "COMPUTER";
            }
            else if (compint == 2 &amp;&amp; input == 1)
            {
                winner = "COMPUTER";
            }
            else if (compint == 3 &amp;&amp; input == 2)
            {
                winner = "COMPUTER";
            }
            else
            {
                winner = "USER";
            }

            System.out.print("Computer: " + compmove + " | ");
            System.out.print("You: " + usermove + " | ");
            System.out.println("Winner: " + winner);
            System.out.println();
            count++;
            System.out.print("Enter Rock(1), Paper(2), Scissors(3) {Q to quit]: ");
            input = in.nextInt();


        }
    }
}
</code></pre>
