Java chapter 3
true or false. the = operator and the == operator perform the same operation
false
true or false. a conditionally executed statement should be indented one level from the if clause
true
true or false. all lines in a conditionally excuted block should be indented one level.
true
when determining whether a number is inside a range, it's best to use this operator. a. && b. ! c. || d. ? :
a. &&
this is a boolean variable that signals when some condition exists in the program. a. flag b. signal c. sentinel d. siren
a. flag
you can use this method to display formatted output in a console window. a. Format.out.println b. Console.fomat c. System.out.printf d. System.out.formatted
c. System.out.printf
This is an if statement that appears inside another if statement a. nested if statement b. tiered if statement c. dislodged if statement d. structured if statement
a. nested if statement
>, <, and == are _____. a. relational operators b. decision expression c. unconditional expression d. boolean expression
a. relational operators
an else clause always goes with ______. a. the closest previous if clause that doesn't already have its own else clause. b. the closest if clause c. the if clause that is randomly selected by the compiler d. none of these
a. the closest previous if clause that doesn't already have its own else clause.
How does that character 'A' compare the the character 'B'? a. 'A' is greater than 'B' b. 'A' is less than 'B' c. 'A' is equal to 'B' d. you cannot compare characters
b. 'A' is less than 'B'
The if statement is an example of a _____. a. sequence structure b. decision structure c. pathway structure d. class structure
b. decision structure
This is an empty statement that does nothing. a. missing statement b. virtual statement c. null statement d. conditional statement
c. null statement
this determines wheter two different string objects contain the same string. a. the == operator b. the = operator c. the equals method d. the stringCompare method
c. the equals method
the conditional operator takes this many operands. a. one b. two c. three d. four
c. three
true or false. when an if statement is nested in the if clause of another statement, the only time the inner if statement is executed is when the boolean expression of the outer if statement is true.
true
This section of a switch statement is branched to if none of of the case expressions match the switch expression. a. else b. default c. case d. otherwise
b. default
&&, ||, and ! are _______. a. relational operators b. logical operators c. conditional operators d. ternary operators
b. logical operators
This type of expression has a value of either true or false a. binary expression b. decision expression c. unconditional expression d. boolean expression
d. boolean expression
To create a block of statements, you enclose the statements in these. a. parentheses() b. square brackets [] c. angled brackets <> d. braces {}
d. braces {}
true or false. when an if statement is nested in the else clause of another statement, the only time the inner if statement is executed is when the boolean expression of the outer if statement is true.
false
true or false. the scope of a variable is limited to the block in which it is defined.
true
who likes to poop?
wes