All pastes #208461 Raw Edit

ItemRegister.java

public java v1 · immutable
#208461 ·published 2006-10-18 17:04 UTC
rendered paste body
package model;import java.util.ArrayList;import server.ShoppingException;public class ItemRegister{    ArrayList<ItemVO> alItems;        public ItemRegister()    {        alItems = new ArrayList();    }        public void addItem(ItemVO item) throws ShoppingException    {        alItems.add(item);    }        public ItemVO getLastItem() throws ShoppingException    {        if(alItems.isEmpty())        {            throw new ShoppingException("Listen er tom!");        }        else        {            return alItems.get(alItems.size() - 1);        }    }}