-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMain.java
More file actions
32 lines (27 loc) · 931 Bytes
/
Copy pathMain.java
File metadata and controls
32 lines (27 loc) · 931 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
28
29
30
31
32
package ds;
import ds.producer.FlourProducer;
import ds.producer.OilProducer;
import ds.producer.SugarProducer;
import ds.shop.HalvahShop;
import ds.shop.HotFlakyPastyShop;
import ds.silo.Silo;
public class Main {
public static void main(String[] args) {
Silo sugarSilo = new Silo("Sugar");
Silo oilSilo = new Silo("Oil");
Silo flourSilo = new Silo("Flour");
new SugarProducer(sugarSilo).start();
new OilProducer(oilSilo).start();
new FlourProducer(flourSilo).start();
new HotFlakyPastyShop(oilSilo, flourSilo).start();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
new HalvahShop(oilSilo, flourSilo, sugarSilo).start();
while (true) {
System.out.println(oilSilo.toString() + " " + flourSilo.toString() + " " + sugarSilo.toString());
}
}
}