public class Pizza {
private String size;
private String crust;
private String cheese;
// Master Constructor: The only one that sets the fields
public Pizza(String size, String crust, String cheese) {
this.size = size;
this.crust = crust;
this.cheese = cheese;
}
// Intermediate: Supplies "Normal" cheese and delegates
public Pizza(String size, String crust) {
this(size, crust, "Normal");
}
// Basic: Supplies "Thin" crust and delegates to the Intermediate constructor
public Pizza(String size) {
this(size, "Thin");
}
public void printDescription() {
// Use standard concatenation to construct the output
System.out.println("Pizza: " + size + ", " + crust + " crust, " + cheese + " cheese.");
}
}