Hi Ana,
To elaborate a bit on Joanne's answer,
Java allows you to use multiple
Logical Operators within a single
if statement in conjunction with
Conditional Operators, such as:
if (condition1 && condition2) ← requires both condition1 and condition2 to be true
if (condition1 || condition2) ← requires either condition1 or condition2 to be true
Of course, you are not limited to just two Logical Operators. You can have a bunch (and combinations) using inner parenthesis:
if ((condition1 || condition2) && (condition3 || condition4)) ← requires either condition1 or condition2 to be true and either condition3 or condition4 to be true
In addiiton, nested
if statements are valid along with the
else if and
else keywords in combination. For more information, I encourage you to review the
Java Tutorials on Flow Control.