public class Car extends Thread {
    private FAShuttle x; // the monitor object
  
    public Car(FAShuttle x) {
        this.x = x;
    }

    public void run() {
        while (true) {
            x.offer();
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {}
        }
    }
}
