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

📄 orderitem.java

📁 ssd3 exercise2 的题目和答案
💻 JAVA
字号:
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   OrderItem.java


public class OrderItem
{

    public OrderItem(Product product1, int i)
    {
        product = product1;
        quantity = i;
    }

    public Product getProduct()
    {
        return product;
    }

    public int getQuantity()
    {
        return quantity;
    }

    public void setQuantity(int i)
    {
        quantity = i;
    }

    public double getValue()
    {
        return getProduct().getPrice() * (double)getQuantity();
    }

    public String toString()
    {
        return (new StringBuilder()).append(getQuantity()).append(" ").append(getProduct().getCode()).append(" ").append(getProduct().getPrice()).toString();
    }

    private Product product;
    private int quantity;
}

⌨️ 快捷键说明

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