product.java

来自「the applet is used for Grocery Store Sim」· Java 代码 · 共 31 行

JAVA
31
字号
class Product 
{
        private String name;
        private double price;
        private int stock;

        public Product(String name)//the name of the product
        {
            this.name=name;
        }
        public void setPrice(double price)//the price of the product
        {
            this.price=price;
        }
         public double getPrice()
        {
            return price;
        }
        public void setStock(int stock)//the stock of the product
        {
            this.stock=stock;
        }

        public int getStock()
        {
            return stock;
        }

}

⌨️ 快捷键说明

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