title: How do I stop if statement after the first true return value?
body: <p>This code should print out a reply based on user input, user is given 3 tries to enter input after invalid tries. It works when they return all invalid values, but code still asks for user input after they have answered yes or no.</p>
  <pre><code>
  import java.util.*;
  public class Equality {
      public static void main(String[] args) {
          
          Scanner input = new Scanner(System.in);
          System.out.println(&quot;Do you have a job?(yes/no): &quot;);
          String response = input.next();
          
          if(response.equalsIgnoreCase(&quot;yes&quot;)) {
              System.out.println(&quot;You are the breadwinner!&quot;);
          }
          else if(response.equalsIgnoreCase(&quot;no&quot;)) {
              System.out.println(&quot;Keep trying, you will find one!&quot;);
          }
          else {
              System.out.println(&quot;Invalid Entry! Try again!&quot;);
          }
          
          response = input.next();
          if(response.equalsIgnoreCase(&quot;yes&quot;)) {
              System.out.println(&quot;You are the breadwinner!&quot;);
          }
          else if(response.equalsIgnoreCase(&quot;no&quot;)) {
              System.out.println(&quot;Keep trying, you will find one!&quot;);
          }
          else {
              System.out.println(&quot;Invalid Entry! Try again!&quot;);
          }
          
          response = input.next();
          if(response.equalsIgnoreCase(&quot;yes&quot;)) {
              System.out.println(&quot;You are the breadwinner!&quot;);
          }
          else if(response.equalsIgnoreCase(&quot;no&quot;)) {
              System.out.println(&quot;Keep trying, you will find one!&quot;);
          }
          else {
              System.out.println(&quot;Too many invalid entries!&quot;);
          }
      }
  }
  </code></pre>