package onewayStreet; public class FabricCarsFromSense2 extends FabricCars { public FabricCarsFromSense2(onewayStreet o ) { super(o);} protected synchronized void nieuwAutoFromSense2(Car[] c, int i, onewayStreet o) { int carId = getAndIncrementCarId(); c[i]=new CarFromSense2(carId,o ); System.out.print (" Fabric: Car " + c[i].getCarId() + " from: Sense2 . "); } public void run() { Car [] c =new Car[ nMaxCars]; // for thread pool System.out.println ("Fabric Cars from Sense2 begins."); for( int i=0; i< nMaxCars ; i++) { //while(true){ nieuwAutoFromSense2(c, i,getO()); c[i].start(); try {Thread.sleep((int)(Math.random()*SLEEPfromSENSE2));} catch(Exception e) {}; } } }