Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Random;
- public class Panaderia {
- public static void main(String[] args) {
- List<Integer> bizcochos = new ArrayList<Integer>();
- List<Integer> facturas = new ArrayList<Integer>();
- int i=1;
- ProduccionDePanes b = new ProduccionDePanes("Bizcocho", 600, 400, bizcochos);
- ProduccionDePanes f = new ProduccionDePanes("Factura", 1300, 1000, facturas);
- b.start();
- f.start();
- while (true) {
- try {
- Random r = new Random();
- Cliente c = new Cliente(facturas, bizcochos, i);
- c.start();
- Thread.sleep(r.nextInt(1500-800)+800);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement