Does the order of operands in a Boolean affect the order of evaluation? As an example can I rely on
String s = ...;
if (s != null && s.length() > 10) ...
I seem to remember that the Java language does not define order of evaluation and that a null value of `s` could cause a NPE. Is this still true (a) in principle and (b) in practice with the common Java implementations?
I couldn't find the exact duplicate. It's interesting to see the differences of opinions in the answers and get a downvote for it - ah well!
以上就是Does the order of operands in a boolean matter?的详细内容，更多请关注web前端其它相关文章！