Assignemnt #65 Number-Guessing with a Counter

Code

    //tyler hart
    //period 5
    //Number-Guessing with a Counter
    //guess3.java
    //11/6/2015
    
    import java.util.Scanner;
    import java.util.Random;
    public class guess3
    {
        public static void main ( String[] args)
        {
            int n1,n2, n3;
            Random r = new Random();
            Scanner keyboard = new Scanner(System.in);
            System.out.println("I'm Thinking of a number from 1 to 10");
            System.out.print("Your guess:");
            n1 = (1+ r.nextInt(10));
            n2 = keyboard.nextInt();
            n3 = 1;
    		while ( n1 != n2 )
    		{
    			System.out.println("You have guessed " +n3+ " times");
    			System.out.println("That is incorrect. Guess again.");
    			System.out.print("Your guess: ");
    			n2 = keyboard.nextInt();
                n3 ++;
                
    		}
            if (n1==n2)
            {
                System.out.println("That's right! the number was " +n1);
    			System.out.println("You have guessed " +n3+ " times");
            }
        }
    }
    

Picture of the output