title: Why is my method printing multiple times?
body: <p>I have three different programs that all read in from each other. One method creates a toString method for individual objects, the second reads in a file with a list of individual objects, and the third creates an additional toString method that calls the first one and creates a toString for the second method to use. The information is printing multiple times, and I can't figure out why. iList is an array list that contains various objects. The output I am getting is correct, but it is just printing four times instead of one.</p>
  
  <p>toString method in first program:</p>
  
  <pre><code>public String toString() {
  
    NumberFormat dollarFmt = NumberFormat.getCurrencyInstance();
    DecimalFormat percentFmt = new DecimalFormat("#.0%");
  
    String output = "\nDescription: " + description.trim(); 
    output += "\nCost: " + dollarFmt.format(cost); 
    output += "   Percent Depreciation: " 
       + percentFmt.format(percentDepreciated);    
    output += "\nCurrent Value: " 
       + dollarFmt.format(cost - (cost * percentDepreciated));
  
    if (isEligibleToScrape()) {
       output += "\n*** Eligible to scrape ***";
    }   
  
    if (percentDepreciatedOutOfRange()) {
       output += "\n*** Percent Depreciated appears to be out of range ***";
    }
  }
  </code></pre>
  
  <p>toString method in third program:</p>
  
  <pre><code>public String toString() { 
  
    String output = ("\n" + inventoryName + "\n");
  
    int index = 1;
    while (index &lt; iList.size()) {
  
       output += (iList.toString());  
  
       index++;
    }
  
    return output;
  }
  </code></pre>
  
  <p>Calling toString from the third program in the second program:</p>
  
  <pre><code>Inventory myInventoryList 
       = new Inventory(inventoryName, inventoryList);
  
    System.out.println(myInventoryList.toString());
  </code></pre>