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