public class Product
/* Instance variables */
public int stockLevel;
// The number of items of this product in stock which is updated
// by the deliver() and acquire() methods. Objects of other
// classes will need to find out its value.
public String description;
// The name of the product which will be set to a meaningful
// string by the constructor, and then never changed.
// Objects of other classes will need to find out its value.
/** Constructor for objects of class Product
public Product(String aDescription)
this.stockLevel = 0;
this.description = aDescription;
/* Instance methods */
* Reduce the stock level by the value of the argument.
* Method presumes availability has already been checked.
public void deliver(int anAmount)
this.stockLevel = this.stockLevel - anAmount;
* Increase the stock level by the value of the argument
public void acquire(int anAmount)
this.stockLevel = this.stockLevel + anAmount;
* Returns a string giving details of the product
public String productDetails()
return "Product " + this.description + ": " + this.stockLevel
+ " in stock.";
}what I have come up with so far is I will declare