import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.Lock; class Monitor { private Lock l?s = new ReentrantLock(); private int st?rsteTall = -1; public void hentTall(int tall) { l?s.lock(); try { if (tall > st?rsteTall) { st?rsteTall = tall; System.out.println(st?rsteTall); } } finally { l?s.unlock(); } } public int st?rsteTall() { return st?rsteTall; } }