/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Capitulo_8.Almacen;

/**
 *
 * @author felix
 */
    class Consumidor extends Thread {
      private Almacen almacen;
      private int numero;

      public Consumidor(Almacen unDeposito, int unNnumero) {
         almacen = unDeposito;
         this.numero = unNnumero;
      }

      @Override
      public void run() {
         int value = 0;
            for (int i = 0; i < 10; i++) {
               value = almacen.get();
               System.out.println("Consumidor #" 
                           + this.numero
                           + " toma: " + value);
            }
      }
}
