public class Pizza { private String pizzaSize; // mandatory private String crust; // mandatory private int cheeseCount; // optional private int pepperoniCount; // optional private int hamCount; // optional private int mushroomsCount; // optional public Pizza(String pizzaSize, String crust) { this(pizzaSize, crust, 0, 0, 0, 0); } public Pizza(String pizzaSize, String crust, int cheeseCount) { this(pizzaSize, crust, cheeseCount, 0, 0, 0); } public Pizza(String pizzaSize, String crust, int cheeseCount, int pepperoniCount) { this(pizzaSize, crust, cheeseCount, pepperoniCount, 0, 0); } public Pizza(String pizzaSize, String crust, int cheeseCount, int pepperoniCount, int hamCount) { this(pizzaSize, crust, cheeseCount, pepperoniCount, hamCount, 0); } public Pizza(String pizzaSize, String crust, int cheeseCount, int pepperoniCount, int hamCount, int mushroomsCount) { this.pizzaSize = pizzaSize; this.crust = crust; this.cheeseCount = cheeseCount; this.pepperoniCount = pepperoniCount; this.hamCount = hamCount; this.mushroomsCount = mushroomsCount; } // getters }