<H1>Synchronized</H1>
<I>Result of two concurrent calls to incrementSeveralTimes() is?</I>
                
private int _count;
public synchronized int getCount() { return _count; }
public synchronized void setCount(int value) { _count = value; }

public void incrementSeveralTimes()
{
    new Thread(new Runnable()
    {
        public void run()
        {
            for(int i = 0; i &lt; 1000; i++)
            {
                int count = getCount();
                setCount(count + 1);
            }
        }
    }).start();                   
}
