forked from PacktPublishing/Java-Coding-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (19 loc) · 764 Bytes
/
Main.java
File metadata and controls
27 lines (19 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package modern.challenge;
public class Main {
public static void main(String[] args) {
System.out.println("Neapolitan pizza:");
Pizza nPizza = new Pizza();
PizzaMaker nMaker = new NeapolitanPizza();
nMaker.make(nPizza);
System.out.println();
System.out.println("Greek pizza:");
Pizza gPizza = new Pizza();
PizzaMaker gMaker = new GreekPizza();
gMaker.make(gPizza);
System.out.println();
System.out.println("Sicilian pizza:");
Pizza sPizza = new Pizza();
new PizzaLambda().make(sPizza, (Pizza p)
-> System.out.println("Add: bits of tomato, onion, anchovies, and herbs"));
}
}