COP2253 Zybooks Chapter Three Flashcards
branch
a program path taken only if an expression’s value is true
if-else structure
two branches, one taken if an expression is true, else the other branch is taken (else may be ommitted)
if statement
executes a group of statements if an expression is true
braces
{}
brackets
[]
equality operator
==
nested if-else
the branch of one if-else statement contains another if-else statement
Boolean
a type that has just two values, true or false
relational operator
checks how one operand’s value relates to another (, <=, >=)
logical operator
treats operands as being true or false, and evaluates to true or false (include AND, OR, NOT)
logical AND
&&
logical OR
||
logical NOT
!
switch statement
executes the first case whose constant expression matches the value of the switch expression, executes the case’s statements, and then jumps to the end: break statement (if there is no matching case, then default statements are executed)
equals method (equalsIgnoreCase)
used to compare strings, returns true if strings are equal