Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何有多个 IF 表达式?像这样 :
If (expression1)&&(expression2)&&...{}
我怎样才能做到这一点?
您将希望使用如下语法:
if ( (1<2) && (2>3) || (100 == 10*10 ) ) { }
在 if 语句中使用多个表达式时要记住的另一件事是短路的行为:http ://en.wikipedia.org/wiki/Short-circuit_evaluation