Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tp05;
- public class Extraccion extends Thread {
- private RegionCritica cuenta;
- public Extraccion(RegionCritica cont) {
- cuenta = cont;
- }
- @Override
- public void run() {
- try {
- while(cuenta.GetContador()<500) {}
- sleep(100);
- double i = cuenta.GetContador();
- cuenta.setContador(i-500);
- System.out.println("Extraccion exitosa : ");
- System.out.println("Saldo actual : "+cuenta.GetContador());
- }catch (InterruptedException e) {
- System.out.println("ERROR EXTRACCION...");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement