Volatile and synchronized keywords in Java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3519664/difference-between-volatile-and-synchronized-in-java-j2me">Difference between volatile and synchronized in JAVA (j2me)</a>  </p>
</blockquote>



<p>I am a bit confused with the 2 java keywords <code>synchronized</code> and <code>volatile</code>. </p>

<p>To what i understand, since java is a <code>multi-threaded</code> language, and by using the keyword <code>synchronized</code> will force it to be executed in 1 thread. Am i correct ?</p>

<p>And <code>volatile</code> also does the same thing ?</p>
