/* * 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 gazstation2; import java.util.Random; /** * * @author denis */ class GazProducer extends Thread{ private FilingColumn column; public GazProducer(FilingColumn column){ this.column = column; } @Override public void run() { System.out.println("Бензовоз выехал"); call(); } void call() { int fuel = (new Random().nextInt(4)+1)*100; column.addFuel(fuel); System.out.println("Бензовоз залил " + fuel + " л., Остаток = " + column.getBigTank()); } }