hopefully its easy.
in main class I have got method from proff
private class AddBBQChips implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
addChips( BagOfChips.Flavor.BBQ );
}
}
private void addChips(final BagOfChips.Flavor flavor){
BagOfChips bag = new BagOfChips( flavor );
System.out.println(bag.toString());
}
and from my class "BagofChips"
public String name;
BagOfChips(String flavor){
name= flavor;
}
public String toString(){
return name;
}
of course, it does not run. What's wrong with it?
I can only modify the second one.