title: I'm trying to call a method through a for loop, and the first iteration will only read the first line of code in the method
body: <p>I'm trying to use an enhanced for loop to call a method many times in a row, but if I'm iterating more than once, the first iteration will only read the first line of code. Here are both of the methods I'm using:</p>
  <pre><code>public Account() {
  
      this.subDetails = new HashMap&lt;Integer, String&gt;();
      
      System.out.println(&quot;What is the account type? (Individual/Family)&quot;);
      String planType = keyboard.nextLine();
      
      System.out.println(&quot;Enter your card number: &quot;);
      this.cardNum = keyboard.nextLine();
      
      System.out.println(&quot;Enter the expiration date: &quot;);
      this.cardExp = keyboard.nextLine();
      
      if (planType.equals(&quot;Family&quot;)) {
          System.out.println(&quot;How many users?&quot;);
          int numUsers = keyboard.nextInt();
          for (int z=0; z&lt;numUsers; z++) {
              this.addUser();
          }
          StreamingService.numFamUsers = StreamingService.numFamUsers + numUsers;
          StreamingService.monthlyRevenue = StreamingService.monthlyRevenue + 14.99;
          StreamingService.monthlyFamRevenue = StreamingService.monthlyFamRevenue + 14.99;
      }
      else if (planType.equals(&quot;Individual&quot;)) {
          this.addUser();
          StreamingService.numIndUsers++;
          StreamingService.monthlyRevenue = StreamingService.monthlyRevenue + 9.99;
          StreamingService.monthlyIndRevenue = StreamingService.monthlyIndRevenue + 9.99;
      }
      StreamingService.numAccounts++;
      this.subDetails.put(i, planType);
      i++;
  
  }
  
  
  public void addUser() {
          System.out.println(&quot;What is the email of the next user?&quot;);
          String e = keyboard.nextLine();
          User y = new User(e, i);
          StreamingService.userEmails.add(y);
          StreamingService.numUsers++;
          this.acctUsers.add(e);
  }
  </code></pre>
  <p>And here is the output (Data quality is poor, just used as an example):</p>
  <blockquote>
  <p>What is the account type? (Individual/Family)</p>
  <p>Individual</p>
  <p>Enter your card number:</p>
  <p>1234123412341234</p>
  <p>Enter the expiration date:</p>
  <p>02/24</p>
  <p>What is the email of the next user?</p>
  <p>abc@def.com</p>
  <p>What is the account type? (Individual/Family)</p>
  <p>Family</p>
  <p>Enter your card number:</p>
  <p>1234123412341234</p>
  <p>Enter the expiration date:</p>
  <p>02/24</p>
  <p>How many users?</p>
  <p>3</p>
  <p>What is the email of the next user? What is the email of the next
  user?</p>
  <p>abc@def.com</p>
  <p>What is the email of the next user?</p>
  <p>abc@defg.com</p>
  <p>What is the account type? (Individual/Family)</p>
  <p>Family</p>
  <p>Enter your card number:</p>
  <p>1234123412341234</p>
  <p>Enter the expiration date:</p>
  <p>02/24</p>
  <p>How many users?</p>
  <p>2</p>
  <p>What is the email of the next user? What is the email of the next
  user?</p>
  <p>xyz@abc.com</p>
  </blockquote>
  <p>Does anyone know how to fix this?</p>