1/58
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
IF STATEMENT
The simplest statement you can use to make
a decision is the
SINGLE ALTERNATIVE SELECTION
OTHER TERM FOR IF STATEMENT
SINGLE ALTERNATIVE SELECTION
because there is only one
alternative-the true alternative.
DOUBLE EQUAL SIGN
WHAT IS THE JAVAS EQUIVALENCY OPERATOR
DOUBLE EQUAL SIGN
is used to determine equality;
IF ELSE
provides the mechanism to
perform one action when a Boolean
expression evaluates as true and a
different action when a Boolean
expression evaluates as false.
DUAL ALTERNATIVE
In other words, you use an if...else
statement for a dual-alternative
selection.
TRUE
To execute more than one statement
that depends on the evaluation of a
Boolean expression, you use a pair of
curly braces to place the dependent
statements within a block.
TRUE
When you block statements, you must remember that any variable
you declare within a block is local to that block.
SWITCH STATEMENT
is useful when you need to test a single variable
against a series of exact integer
SWITCH
starts the statement and is followed immediately by a test
expression enclosed in parentheses.
CASE
is followed by one of the possible values for the test expression
and a colon.
BREAK
optionally terminates a switch statement at the end of each case.
DEFAULT
optionally is used prior to any action that should occur if the
test variable does not match any case.
CONDITIONAL OPERATOR
requires three expressions separated with a question mark and a
colon; it is used as an abbreviated version of the if else statement.
CONDITIONAL OPERATOR
it is simply a convenient shortcut.
NOT OPERATOR
to negate the result of any Boolean
expression.
TRUE
Any expression that evaluates as
true becomes false when preceded
by the NOT operator, and
accordingly, any false expression
preceded by the NOT operator
becomes true.
LOOP
is a structure that allows repeated execution of a block of
statements.
LOOP BODY
a block of statements called the
BOOLEAN EXPRESSION
Within a looping structure, a — —- is evaluated.
SINGLE STATEMENT, BLOCK OF STATEMENT
The loop body can be a
— —-, or a —— between curly braces.
ITERATION
One execution of any
loop is called an
TRUE
As long as the loop-controlling, Boolean expression is true, the
statements in the loop body continue to execute. When the
Boolean evaluation is false, the loop ends.
WHILE LOOP
in which the loop-controlling
Boolean expression is the first statement in the
loop, evaluated before the loop body ever
executes
FOR LOOP
which is usually used as a concise
format in which to execute loops
DO WHILE LOOP
in which the loop-controlling
Boolean expression is the last statement in the
loop, evaluated after the loop body executes one
time.
DEFINITE LOOP OR COUNTED LOOP
A loop that executes a specific number of times is a
INDEFINTE LOOP
Sometimes a programmer does not know how many times a
loop will execute because the number of iterations is determined while the
program is running. Such a loop is an
EVENT CONTROLLED LOOP
the value of a loop control variable is not altered by adding to
it or subtracting from it, but instead is altered by some other event.
Such a loop is an
EVENT CONTROLLED LOOP
is a type of indefinite loop because you
don't know how many times it eventually will repeat during each
program execution.
FOR LOOP
is a special loop that is convenient to use when a definite
number of loop iterations is required; it provides a concise way to
create a counter-controlled loop.
FOR LOOP
provides you with a shorthand notation for this type of
loop.
ARRAY
is a named list of data items that all have the same data type.
DATA ITEM
Each — —- is an element of the array.
ARRAY LIST
that
can be used to create containers that store lists of objects.
ARRAY LIST
is dynamically resizable, meaning
that its size can change during program execution.
EXCEPTION
is an unexpected or error condition.
EXCEPTION HANDLING
is the name for the object-oriented techniques
that manage or resolve such errors.
RUNTIME ERROR
Unplanned exceptions that occur
during a program's execution are also called
ERRORS AND EXCEPTION
Java includes two basic classes of errors: WHAT IS IT? AND IT IS IN THROWABLE CLASS
OBJECT CLASS
which is defined in the automatically imported
java.lang package
CATCH BLOCK
is a segment of code that can handle an exception that
might be thrown by the try block that precedes
THROWN STATEMENT
is one that sends an Exception object out of a
block or a method so that it can be handed elsewhere.
CATCH BLOCK
A thrown
Exception can be caught by a
TRY
a procedure that might cause
an error.
THROWS
A method that detects an error condition “——” an
exception,
CATCH
and if you write a block of code that processes the error, that
block is said to , “—-” the exception.
UNCHECKED EXCEPTIONS
These exceptions inherit from the Error
class or the RuntimeException class.
CHECKED EXCEPTIONS
These exceptions are the type that
programmers should anticipate and from which programs should
be able to recover.
CHECKED EXCEPTIONS
All exceptions that you explicitly throw and
that descend from the Exception class are — —-
TRUE
You can provide any legal identifier you want for an array,
TRUE
programmers conventionally name arrays by following the same rules they
use for variables—array names start with a lowercase letter and use
uppercase letters to begin subsequent words.
TRUE
When you use the keyword new to define an array, the array
reference acquires a memory address value.
TRUE
You also can assign nondefault values to array elements upon
creation.
TRUE
Just as you can declare arrays of
simple types such as int or double,
you can declare arrays that hold
elements of objects.
TRUE
To construct an array of objects using a default constructor, you must
still call the constructor using the keyword new for each declared array
element.
TRUE
To use a method that belongs to an object that is part of an array,
you insert the appropriate subscript notation after the array name
and before the dot that precedes the method name
ARRAY LIST
An — —- can hold any type of object;