Chapter 3 Flashcards
what does the if-else do?
First checks the expression in parentheses after the keyword if. This expression must be something that is either true or false. If it is true, the statement before the else is executed. If the expression is false, the statement after the else is executed.
If you write if (x = y) instead of if (x == y) to test whether x and y are equal, you will get a ____ message.
syntax error
What are these called? &&; , || ?
logical operators
True or False, The parentheses in (pressure > min) and in (pressure < max) are not required
True
True or False , You often can avoid using !, and you should do so when possible.
True
if boolean expression A is true, and boolean expression B is false, A && B evaluates to
False
To see whether two strings have equal values, you must use the method
s1.equals(s2) rather than = =
lexicographic order means
the letters and other characters are ordered according to their Unicode sequence
If we haven’t used else at the end of the loop and If none of the boolean expressions is true, what would happen?
nothing happenes
What is this called System.exit(0); ?
The exit Method
The Operator Precedence for booleans are:
the boolean operators ==, != the boolean operator & the boolean operator | the boolean operator && the boolean operator ||
True or False: you may spell true and false using either uppercase or lowercase letters or a combination of both. in nextBoolean is more forgiving.
True
What comes after Switch statement?
switch (Controlling_expression)
What is case label?
is the case that comes after the switch statement
In switch statement, could you or could you not have a duplicate case labels?
you cant