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

📄 product.java

📁 the applet is used for Grocery Store Simulation,When you execute the main() method, the output shoul
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -