title: Stop do while loop from executing the next loop after breaking from the current loop
body: <p>This code works fine when PIN is wrong but when it is correct it breaks from the first loop and then continues to ask for PUK. I want it to work in such a way that if the PIN is correct the entire program breaks. </p>
  
  <p>This is the code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class PINDemo {
  public static void main(String [] args) {
  
      String PIN = "12345";
      String PUK = "123456789";
      int attempts = 1;
      String entry;
      Scanner obj = new Scanner(System.in);       
      lab1:do {
          System.out.println("Enter your PIN");
          attempts++;
          entry = obj.next();
  
  
          if(!entry.equals(PIN)) {
              System.out.println("Wrong PIN. Attempt "+attempts);
          }
          else {
              System.out.println("PIN Correct. SIM Unlocked");
              break ;
  
          }
  
      }while(attempts &lt; 4);
  
  
      System.out.println("PIN Blocked. Please enter your PUK");
      for(attempts = 1;attempts &lt; 4; attempts++) {
          entry = obj.next();
          if(!entry.equals(PUK)) {
              System.out.println("Wrong PUK try again");
  
          }
          else {
              System.out.println("PUK Correct. SIM Unlocked");
          }
  
  
  }
  
      }
  
  }
  </code></pre>