📜  空检查的java顺序 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:27.178000             🧑  作者: Mango

代码示例1
The second version ( null == str ) is called a yoda condition.

They both result in the same behavior, 
but the second one has one advantage: 
It prevents you from accidentally changing a variable, 
when you forget one =. In that case the compiler returns an error at that
row and you're not left with some weird behavior of your code and the resulting debugging.