Java chapter 4

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

Flag

The ____ statement is used to create a decision structure, which allows a program to have more than one path of execution.

If

&&, ||, ! are all examples of _________ operators.

Logical

___________ operators connect two or more relational expressions into one or reverse the logic of an expression.

Logical

The Switch statement is a ____________________ structure. It allows you to test the value of a variable or an expression, then use that value to determine which statement or set of statements to execute.

Multiple decision

>, <, >=, <=, ==, != are all examples of _________ operators.

Relational

A __________ operator determines whether a specific relationship exists between two values.

Relational

True or False: A block of code is conditionally executed when it is performed only when a certain condition exists.

True

True or False: An if statement can be nested inside another if statement.

True

True or False: In unicode 'A' is not the same as 'a'.

True

True or False: Logical OR will evaluate to true as soon as it sees that one of its operands is a true expression. ( this is also short-circuit evaluation.)

True

The if statement uses a _____________ to decide whether the next statement or block of statements executes.

boolean

The _____ operator reverses the truth of a boolean expression. If it is applied to an expression that is true, the operator returns false. It it is applied to an expression that is false, the operator returns true.

! (not)

The ______ operator connects two boolean expressions into one. Both expressions must be true for the overall expression to be true.

&&(and)

You can use the __________ operator to create short expressions that work like if-else statements. (BooleanExpression ? value1 : value2;)

Conditional

Many algorithms require a program to execute some statements only under certain circumstances. This can be accomplished with a ___________ structure.

Decision

The && operator performs _____________________. Here's how it works, if the expression on the left side of the && operator is false, the expression on the right side will not be checked.

Short-circuit evaluation

The __________ statement lets the value of a variable or expression determine to where the program will branch.

Switch

True or False: Remember that when curly braces are not used with an if statement, only the next statement after the if condition will be executed conditionally.

True

True or False: The Java API has a class, Random, for this purpose. To use the Random class, use the following import statement and create an instance of the class. import java.util.Random; Random randomNumbers = new Random();

True

True or False: The if-else-if statement tests a series of conditions. It is often simpler to test a series of conditions with the if-else-if statement than with a set of nested if-else statements.

True

True or False: The switch statement can evaluate a char, byte, short, int, or string value and make decisions based on the value.

True

True or False: You should never put a semicolon after the parenthesis of an if statement.

True

True or False: You should not use relational operators to compare String objects. Instead, you should use an appropriate String method.

True

The _________ operator connects two boolean expressions into one. One or both expressions must be true for the overall expression to be true. It is only necessary for one to be true, and it does not matter which one.

|| (or)


संबंधित स्टडी सेट्स

MGMT 490: Chapter 6 - Learnsmart, Activity and Quiz questions

View Set

BUSINESS COMMUNICATION CARDON CH 9

View Set

Principles of Advertising CH. 9 Planning Media Strategy: Disseminating the Message

View Set