This is my first time using enum in a class. I want to create a Pizza class so the user can create a Pizza object and then set the size, get the size, set the number of cheese etc.. Pizza() is the default constructor to initialize a Pizza object with no arguments. Thanks!!
package PizzaPackage;
public class Pizza {
private enum PizzaSize {
small, medium, large }
protected int numcheese;
protected int numpep;
protected int numham;
Pizza(){
PizzaSize newpizza= PizzaSize.medium; //Is this correct?
numcheese = 1;
numpep =0;
numham=0;
}
public int getnumcheese() {
return this.numcheese;
}
public int getnumpep() {
return this.numpep;
}
public int getnumham() {
return this.numham;
}
public void setSize(PizzaSize newpizza){
//???
}
public PizzaSize getSize(){
//???
}
}