title: Java: If variable is empty (from user input); break; else continue the main method
body: <p>sorry if this is a silly question but I am looking for a way to break and start another iteration of the loop if the user's input is null.
  Here's my code:</p>
  
  <pre><code>while(true) {
      // Get the users input
      Scanner Input = new Scanner(System.in);
      System.out.println("Enter text:");
      String studentInfo = Input.nextLine();
  
      if (studentInfo == null) {
          System.out.println("Please enter valid infomation.");
          break;
      }
      continue;
  }
  </code></pre>
  
  <p>After the break, I want it to go back to the while(true) and start again from there, by asking the user for an input again.</p>
  
  <p>Thanks guys, </p>
  
  <p>JT</p>