title: Why IF condition is not fulfilled on android
body: <p>I just want to know why the compiler allow to continue the program normally in the first condition:</p>
  
  <pre><code>public void ButtonOnClickDirectoryList(View v){
      try {
          if (!spnOptionSelectedDepartment.equals(null) &amp;&amp; !spnOptionSelectedCities.equals(null)) {
              if (!spnOptionSelectedTypes.equals(null)) { //code....}
  </code></pre>
  
  <p>the spnOptionSelectedDepartment and spnOptionSelectedTypes are Strings and are defined at the begining of the class like this:</p>
  
  <pre><code>private String spnOptionSelectedDepartment = null;
  private String spnOptionSelectedCities = null;
  private String spnOptionSelectedTypes = null;
  </code></pre>
  
  <p>so when I press the button, it call this method and this are the values that I have in the moment:</p>
  
  <pre><code>spnOptionSelectedDepartment = "9999"
  spnOptionSelectedCities = null
  spnOptionSelectedTypes = null
  </code></pre>
  
  <p>so when I put a break point on this condition it just continue validating the rest of the code inside that if...
  Could anybody explain me why this behavior?</p>
  
  <p>Let me edit the question, Yes it throws nullpointer exception on the second if...</p>
  
  <pre><code>if (!spnOptionSelectedTypes.equals(null)) {
  </code></pre>
  
  <p>but why it allows the first IF when spnOptionSelectedCities = null...?</p>