import java.util.ArrayList;

    // Record a collection of callers to a radio phone-in program.
    // An illustration of the ArrayList class.
class RadioShow {
    public RadioShow(String prog){
        programme = prog;
    }

        // Add the given caller to the current list.
    public void addCaller(String c){
        ArrayList callers = getCallers();
        callers.add(c);
    }

        // Replace one caller with another.
    public void replaceCaller(int which,String newCaller){
        ArrayList callers = getCallers();
        callers.set(which,newCaller);
    }

    public String selectCaller(int which){
        ArrayList callers = getCallers();
        return (String) callers.get(which);
    }

        // How many callers in the collection?
    public int numCallers(){
        return getCallers().size();
    }

    public String getProgramme(){
        return programme;
    }

    private ArrayList getCallers(){
        return callers;
    }

    // Which programme they are calling into.
    private final String programme;
    // The collection of caller names.
    private ArrayList callers = new ArrayList();
}
