Java chapter 4

¡Supera tus tareas y exámenes ahora con Quizwiz!

The = operator and that == operator performs the same operation

False

import java.text.DecimalFormat;

Import for the DecimalFormat Class

relational operators

In most cases, the Boolean expression, used by the if statement, uses ______

String objects

In most cases, you cannot use the relational operators to compare two ______ ______

equalsIgnoreCase compareToIgnoreCase

In order to compare two String objects that might have different case use what?

case sensitive

In the String class the equals and compareTo methods are _________ ________ .

unary

Java provides one _____(!) logical operator to reverse the truth of a boolean expression.

binary logical operators

Java provides two ______ (&& and ||) that are used to combine boolean expressions.

Short-circuit Evaluation

Logical AND and logical OR operations perform ________ ________ of expressions. && ||

&& || !

Logical operator

this is an if statement that appears inside another if statement

Nested if statement

!

Not

This is an empty statement that does nothing

Null statement

Conditionally Executed

Only performed when a certain condition exists

||

Or

>,<,== are

Relational operator

The ______ of a variable is limited to the block in which it is declared.

Scope

method

The scope of a local variable begins at the point it is declared and terminates at the end of the ________.

This determines whether two different String objects contain the same string

The stringCompare method

evaluate a char, byte, short, int, or string

The switch statement can evaluate a ____________, _______, ________, ________ value and make decisions based on the value.

The conditional operators take this many operands

Three

False || True

True

Flag

________ can be tested to see if the condition has changed.

Characters

________ can be tested using the relational operators.

Unicode

________ is stored as a sixteen (16) bit number.

if statement

_________ decides whether a section of code executes or not.

Parenthesis

__________ can be used to force the precedence to be changed.

Boolean expression

__________ is any variable or calculation that results in a true or false condition.

Reference

__________ variables contain the address of the object they represent.

Switch statement

allows you to use an ordinal value to determine how a program will branch.

number = x > y ? 10 : 5;

if(x > y) number = 10; else number = 5;

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

"A" is less then "B"

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

&&

Flag

A Boolean valuable that signals when some conditions exists in the program

Conditional operator

A shorthand method of expressing a simple if else statement

&&

And

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

Boolean express

To create a block of statements you and close the statements in these

Braces {}

Without the ____ statement, the program "falls through" all of the statements below

Break

You can use the ______ operator to create short expressions that work like if else statements

Conditional

The if statement is an example of

Decision structure

The section of a switch statement has branched to if none of the case values match the testExpression

Default

Relational Operator

Determines whether a specific relationship exists between two values

!true

False

Sequence Structure

Statements that execute in sequence

higher

The ! operator has a _______ order of precedence than the && and || operators.

lower

The && and || operators have a ________ precedence than relational operators like < and >.

equalsIgnoreCase

The case of the characters and the strings is Ignored

And else always clause goes with

The closest previous if clause that doesn't already have it's own else clause

DecimalFormat class

The decimal format class can be used to format the appearance of floating point numbers rounded to a specific number of decimal places; Must be imported

Trailing else

The last else clause that doesn't have an if statement following it

Random numbers

Used in games, used and computer security to encrypt data, used and simulation programs

statement2; statement3;

What statement would run if (if statement is false) if (expression) statement1; statement2; statement3;

come into scope

When a program enters a section of code where a variable has scope, that variable has _______ _______ _____, which means the variable is visible to the program

Lexicographical comparison

When you use the compareTo method to compare two strings, the strings are compared character by character

expression1 ? expression2 : expression3 x > y ? z = 10 : z = 5;

conditional operator format


Conjuntos de estudio relacionados

Chapter 63: Caring for Clients with Orthopedic and Connective Tissue Disorders

View Set

nur 320 Chapter 2: Family-Centered Care and Cultural Considerations

View Set

Building and Using Queries- Access B

View Set

Chapter 6: Employer payroll Taxes

View Set