Author: Not specified Language: java
Description: Not specified Timestamp: 2017-06-15 07:41:06 +0000
View raw paste Reply
public class PizzaMaker {
        public static void main(String[] args){
                // The PlainPizza object is sent to the Mozzarella constructor
                // and then to the TomatoSauce constructor
                Pizza basicPizza = new TomatoSauce(new Mozzarella(new PlainPizza()));
                System.out.println("Ingredients: " + basicPizza.getDescription());
                System.out.println("Price: " + basicPizza.getCost());
        }
}
View raw paste Reply