title: Continue outside of loop error despite it being inside the loop
body: <p>I can't run this code because of a continue outside loop error. </p>
  
  <p>I have looked online and found that people had issues due to having an extra semi-colon. I don't have that issue but yet I still get this error.</p>
  
  <pre><code>public class GuessingGame {
  
       int random;
  
      public void generateNumber() 
      {
         //The following lines generate and output a random number between 1 and 10
          random = (int)(Math.random()*10)+1;
  
      }
  
     //Write the guess() method below 
     public void guess()
     {
         //Use scanner to accept a user input 
         //Create a new scanner object to receive user input
            Scanner sc=new Scanner(System.in);
            System.out.println("Enter you guess between 1 to 10");
            int guess = sc.nextInt();
  
            //write your code below
         if (guess == random){
             System.out.println("You guessed it right, the number is " + random);
  
         } else if (guess&lt;random) {
             System.out.println("You guessed too low!");
             continue;
  
         } else {
             System.out.println("You guessed too low");
             continue;
  
         }
     }
  </code></pre>
  
  <p>I get this error whenever I run it. Error:(35, 12) java: continue outside of loop</p>