title: What is the difference between comparing boolean value with boolean variable using = and ==?
body: <p>Lets say if there is a boolean variable status. Assume status has value false.</p>
  
  <p>I would like to know what is the difference between</p>
  
  <pre><code>if ( status = true )
  {
     //block of code
  }
  
  if ( status == true )
  {
     //block of code
  }
  </code></pre>
  
  <p>I've tried to understand it by writing a sample program, the code in the first if block gets executed for whatever the value status is having (true or false).</p>
  
  <p>For other primitive types, system throws compile time error if I use only one "=" in if and why it doesn't throw the error in case of boolean type. Thanks.</p>