title: "Incomparable types: java.lang.String and int" in Terminal
body: <p>I was coding a simple Java program for guessing a right answer in school, and when I brought it home, it come across errors. </p>
  
  <p>At first I changed TerminalIO.KeyboardReader to java.util.Scanner, and now when I run it through Terminal, it returns "Incomparable types: java.lang.String and int".</p>
  
  <p>Any help? Really confused.</p>
  
  <p>Code:</p>
  
  <pre><code>import java.util.Scanner;
  
  import java.util.Random;
  
  public class guess { 
  
         public static void main(String [] args) {
             Scanner keyboard = new Scanner(System.in);
             Random generator = new Random();
             System.out.println("I am thinking of a number from 1 to 10.");
             System.out.println("You must guess what it is.");
             System.out.print("Enter a guess: ");
             int randomNumber = generator.nextInt(10) + 1;
             String x = keyboard.nextLine();
             int guessNum = 1;
             while (x != randomNumber) {
                    System.out.println("Guess again!");
                    x = keyboard.nextLine();
                    guessNum ++;
                  }
                  System.out.println("RIGHT!");
                  System.out.println("You got it correct in " +guessNum + " guesses.");
  
  }
  </code></pre>
  
  <p>}</p>