Gaddis Chapter Two Review Questions

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

'A' is less than 'B'

How does the character 'A' compare to the character 'B'?

braces {}

To create a block of statements, you enclose the statements in these.

flag

This is a boolean variable that signals when some condition exists in the program.

nested if statement

This is an if statement that appears inside another if statement.

logical operators

&&, ||, and ! are _________.

True

All lines in a conditionally executed block should be indented one level.

False

The = operator and the == operator perform the same operation.

three

The conditional operator takes this many operands.

decision structure

The if statement is an example of a ____________.

True

The scope of a variable is limited to the block in which it is defined.

null statement

This an empty statement that does nothing.

the equals method

This determines whether two different String objects contain the same string.

relational operators

>, <, and == are

True

A conditionally executed statement should be indented one level from the if clause.

the closest previous if clause that doesn't already have its own else clause

An else clause always goes with __________.

default

This section of a switch statement is branched to if none of the case expressions match the switch expression.

boolean expression

This type of expression has a value of either true or false.

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.

True

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.

&&

When determining whether a number is inside a range, it's best to use this operator.

System.out.printf

You an use this method to display formatted output in a console window.


Ensembles d'études connexes

PCAT Chemical Processes: Organic Chemistry Alkanes, Alkenes, and Alkynes

View Set

8.07 Unit Test | Personal, Community, and Environmental Health - Part 2

View Set

Thesis Statement & Topic Sentence

View Set

Google Adwords Final Practice Questions

View Set

Special Topics in Religion Midterm Pt 1

View Set

Chapter 3: Keeping Your Real Estate License

View Set

Econ 200: Chapter 15-Gross Domestic Product

View Set

Medical terminology chapter 3 Self test questions:

View Set