title: In Java, what are the boolean "order of operations"?
body: <p>Let's take a simple example of an object <code>Cat</code>.  I want to be sure the "not null" <code>cat</code> is either orange or grey.</p>
  
  <pre><code>if(cat != null &amp;&amp; cat.getColor() == "orange" || cat.getColor() == "grey") {
  //do stuff
  }
  </code></pre>
  
  <p>I believe AND comes first, then the OR.  I'm kinda fuzzy though, so here are my questions: </p>
  
  <ol>
  <li><p>Can someone walk me through this statement so I'm sure I get what happens?</p></li>
  <li><p>Also, what happens if I add parentheses; does that change the order of operations?</p></li>
  <li><p>Will my order of operations change from language to language? </p></li>
  </ol>