title: What is the use of Collections.synchronizedList() method? It doesn't seem to synchronize the list
body: <p>I am trying to add <code>String</code> values to an <code>ArrayList</code> using two threads. What I want is that while one thread is adding the values the other thread should not interfere so I have used the <code>Collections.synchronizedList</code> method. But it appears that if I don't explicitly synchronize on an object the adding is done in an unsynchronized way.</p>
  
  <p>Without explicit synchronized block:</p>
  
  <pre><code>public class SynTest {
      public static void main(String []args){
          final List&lt;String&gt; list=new ArrayList&lt;String&gt;();
          final List&lt;String&gt; synList=Collections.synchronizedList(list);
          final Object o=new Object();
          Thread tOne=new Thread(new Runnable(){
  
              @Override
              public void run() {
                  //synchronized(o){
                  for(int i=0;i&lt;100;i++){
                      System.out.println(synList.add("add one"+i)+ " one");
                  }
                  //}
              }
  
          });
  
          Thread tTwo=new Thread(new Runnable(){
  
              @Override
              public void run() {
                  //synchronized(o){
                  for(int i=0;i&lt;100;i++){
                      System.out.println(synList.add("add two"+i)+" two");
                  }
                  //}
              }
  
          });
          tOne.start();
          tTwo.start();
      }
  }
  </code></pre>
  
  <p>The output that I got is:</p>
  
  <pre><code>true one
  true two
  true one
  true two
  true one
  true two
  true two
  true one
  true one
  true one...
  </code></pre>
  
  <p>With the explicit synchronized block uncommented I'm stopping the interference from the other thread while adding. Once the thread has acquired the lock it is executing until it is finished. </p>
  
  <p>sample output after uncommenting the synchronized block:</p>
  
  <pre><code>true one
  true one
  true one
  true one
  true one
  true one
  true one
  true one...
  </code></pre>
  
  <p>So why is the <code>Collections.synchronizedList()</code> not doing the synchronization?</p>