public class StuffBox
{
    //declare constants here

    //declare variables here if they need to keep their value
    //these are called "instance attributes"

    //instance: a particular occurence of the class
    //attribute: a piece of information about something

    private int[] box;
    int lastFilled;
    
    public StuffBox(int boxSize)
    {
	box = new int[boxSize];
	lastFilled = -1;
    }

    public boolean addStuff(int toAdd)
    {
	if(lastFilled == box.length)
	    return false;

	lastFilled++;
	box[lastFilled]=toAdd;
	return true;
    }

    public int getStuff(int toGet) throws StuffBoxException
    {
	if(lastFilled >= toGet)
	    return  box[toGet];
	else
	    {
		throw new StuffBoxException("Trying to get stuff not in box");
	    }
    }
}
