⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stockmanager.java

📁 现在在国外大学里最流行的java学习软件,同时还有大量的example,在名为project的文件里.安装好后用bluej打开peoject的例子,可以进行你想要的任何变化.同时可以了解大量的源码
💻 JAVA
字号:
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<Product> stock;    /**     * Initialise the stock manager.     */    public StockManager()    {        stock = new ArrayList<Product>();    }    /**     * 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()    {    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -