import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class Monitor { private int teller = 0; Lock l?s = new ReentrantLock(); public void ?k() { l?s.lock(); try { teller++; } finally { l?s.unlock(); } } public void printTall() { l?s.lock(); try { System.out.println(teller); } finally { l?s.unlock(); } } }