title: if (boolean condition) in Java
body: <p>This is always very confusing to me. Can someone please explain it? The confusion I have is - boolean default to false. So in the below example, does it enter the <code>if</code> loop when state is not turned on, i.e., it is TURNED OFF <code>if (condition is false)</code> <strong>OR</strong> does it enter the <code>if</code> loop when state is TURNED ON, in other words <code>if (condition is true)</code>?</p>
  
  <pre><code>boolean turnedOn;
  if (turnedOn) {
      //do stuff when the condition is false or true?
  } else {
      //do else of if
  }
  </code></pre>
  
  <p>I know this is a very basic question, but if you could explain the answer in very basic language, that would be great. :) Feel free to point me to duplicate posts that have a very good explanation (I did not find one where I could clearly get it). Also feel free to change the subject of the post if you'd like to make it more generic.</p>