title: Adding a Value to an Array
body: <p>I have a method which needs to add the provided bank account to an array which I have created:</p>
  
  <pre><code>public boolean addAccount (BankAccount newAccount[]) {
          if (numAccounts == 0) {
              return false;
          }
          else {
              return true;
              for(int counter=0; counter&lt;newAccount.length; counter++)
                  newAccount[counter] += accounts;
          }
      }
  </code></pre>
  
  <p>it is tested by this method:</p>
  
  <pre><code>public static boolean test5() {
      System.out.println("Test5: add an account to a customer.");
      BankAccount b = new BankAccount();
      Customer c1 = new Customer("Alice", "Smith");
      customerCounter ++;
      if (!c1.addAccount(b))
          return false;
  
      return c1.toString().equals("Alice Smith, " + c1.getCustomerID() + "\n" + b.toString() + "\n");
  }
  </code></pre>
  
  <p>However I am getting an error which eclipse does not have a solution for in this line:</p>
  
  <p><code>newAccount[counter] += accounts;</code></p>