有没有可能通过这种方法获得currentStockLevel?

时间:2014-10-25 07:22:27

标签: java methods void

我需要currentStockLevel for java中的另一个void方法,有没有可能得到它? 我认为不,因为无效吗?

public void receive (int currentStock)
{
    String outLine;
    if (currentStockLevel > 0)
        outLine = productCode;
    {
        outLine = ". Current Stock: " + currentStockLevel;
        outLine += " Current Stock changed from " + currentStockLevel;
        currentStockLevel += currentStock;
        outLine += " to " + currentStockLevel;
        int storeCost = wholeSalePrice * currentStockLevel;
        System.out.println (productCode + ":" + " Received " +  currentStockLevel + "." + " Store Cost " + "$" + storeCost + "." + " New stock level: " + currentStockLevel);
    }

0 个答案:

没有答案