title: Calling method from another class, getting error
body: <p>I'm getting an error calling a method from another class. I am in class <strong>StockManager</strong> and am wanting to call <strong>toString</strong> method in class <strong>Product</strong>.</p>
  
  <p>But I'm getting error: <em>Constructor Product in class Product cannot be applied to given types: required: int.java.lang.String; found:no arguments; reason:actual and format argument lists differ in length</em></p>
  
  <p>BTW I'm using BlueJ.</p>
  
  <p>Please note printProductDetails() method below. That is what I am trying to write.</p>
  
  <p>Here is all of what I have got in StockManager class. I'm trying to print out details of toString in Product class in printProductDetails() method below:</p>
  
  <pre><code>import java.util.ArrayList;
  
  /**
   * Manage the stock in a business.
  * The stock is described by zero or more Products.
   * 
   * @author (your name) 
   * @version (a version number or a date)
   */
  public class StockManager
  {
  // A list of the products.
  private ArrayList&lt;Product&gt; stock;
  
  /**
   * Initialise the stock manager.
   */
  public StockManager()
  {
      stock = new ArrayList&lt;Product&gt;();
  }
  
  /**
   * Add a product to the list.
   * @param item The item to be added.
   */
  public void addProduct(Product item)
  {
      stock.add(item);
  }
  
  /**
   * Receive a delivery of a particular product.
   * Increase the quantity of the product by the given amount.
   * @param id The ID of the product.
   * @param amount The amount to increase the quantity by.
   */
  public void delivery(int id, int amount)
  {
  
  }
  
  /**
   * Try to find a product in the stock with the given id.
   * @return The identified product, or null if there is none
   *         with a matching ID.
   */
  public Product findProduct(int id)
  {
      return null;
  }
  
  /**
   * Locate a product with the given ID, and return how
   * many of this item are in stock. If the ID does not
   * match any product, return zero.
   * @param id The ID of the product.
   * @return The quantity of the given product in stock.
   */
  public int numberInStock(int id)
  {
      return 0;
  }
  
  /**
   * Print details of all the products.
   */
  public void printProductDetails()
  {
      Product string = new Product();
      string.toString(); {
                      System.out.println("Attempt to restock " +
                             name +
                             " with a non-positive amount: " +
                             amount);
                          }
  
  }
  }
  </code></pre>
  
  <p>Specific help in how to solve this and some reasons for the suggestions would be appreciated Thank you.</p>
  
  <p>Product Class:</p>
  
  <pre><code>/**
   * Model some details of a product sold by a company.
   * 
   * @author David J. Barnes and Michael Kölling.
   * @version 2011.07.31
   */
  public class Product
  {
  // An identifying number for this product.
  private int id;
  // The name of this product.
  private String name;
  // The quantity of this product in stock.
  private int quantity;
  
  /**
   * Constructor for objects of class Product.
   * The initial stock quantity is zero.
   * @param id The product's identifying number.
   * @param name The product's name.
   */
  public Product(int id, String name)
  {
      this.id = id;
      this.name = name;
      quantity = 0;
  }
  
  /**
   * @return The product's id.
   */
  public int getID()
  {
      return id;
  }
  
  /**
   * @return The product's name.
   */
  public String getName()
  {
      return name;
  }
  
  /**
   * @return The quantity in stock.
   */
  public int getQuantity()
  {
      return quantity;
  }
  
  /**
   * @return The id, name and quantity in stock.
   */
  public String toString()
  {
      return id + ": " +
             name +
             " stock level: " + quantity;
  }
  
  /**
   * Restock with the given amount of this product.
   * The current quantity is incremented by the given amount.
   * @param amount The number of new items added to the stock.
   *               This must be greater than zero.
   */
  public void increaseQuantity(int amount)
  {
      if(amount &gt; 0) {
          quantity += amount;
      }
      else {
          System.out.println("Attempt to restock " +
                             name +
                             " with a non-positive amount: " +
                             amount);
      }
  }
  
  /**
   * Sell one of these products.
   * An error is reported if there appears to be no stock.
   */
  public void sellOne()
  {
      if(quantity &gt; 0) {
          quantity--;
      }
      else {
          System.out.println(
              "Attempt to sell an out of stock item: " + name);
      }
  }
  }
  </code></pre>